Bug 197332 - [IRC] No way to set the topic of a channel
Summary: [IRC] No way to set the topic of a channel
Status: CLOSED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.ui (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 1.2.0   Edit
Assignee: Jakub Jurkiewicz CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-07-20 15:32 EDT by Chris Aniszczyk CLA
Modified: 2008-05-18 19:26 EDT (History)
4 users (show)

See Also:


Attachments
Patch attachment (1.64 KB, patch)
2007-09-28 06:23 EDT, Jakub Jurkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-07-20 15:32:24 EDT
It would be nice if we had a control or something in the UI that represented the channel name and topic. Also a way to set this would be awesome!
Comment 1 Scott Lewis CLA 2007-07-22 20:11:50 EDT
Likely to require additional API.  Setting target milestone to 1.1.0 (first API additions).
Comment 2 Remy Suen CLA 2007-07-29 20:42:10 EDT
(In reply to comment #1)
> Likely to require additional API.

I don't think we have any API, period. We have an IChatRoomAdminListener to listen for subject change events but I couldn't find anything to _set_ the subject.
Comment 3 Scott Lewis CLA 2007-07-30 01:26:54 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Likely to require additional API.
> 
> I don't think we have any API, period. 

Well, I think that's incorrect...as you go onto say...

>We have an IChatRoomAdminListener to
> listen for subject change events but I couldn't find anything to _set_ the
> subject.

True, that's why it's...

> > Likely to require additional API.

So, perhaps someone should propose additional API to meet the 'set' need implied by bug...in concert with the requested UI additions.

Comment 4 Remy Suen CLA 2007-07-30 06:54:58 EDT
;P

What I meant is, "I don't think it's _likely_ it's we _must add_ additional API because I can't find any topic _setting_ API.' But anyway...

I would've said IChatRoomContainerOptionsAdapter, but it's not really exactly an "option" in the preferences sense...
Comment 5 Scott Lewis CLA 2007-09-07 01:42:35 EDT
I've added:

in org.eclipse.ecf.presence.chatroom:

IChatRoomAdminSender (an chat room admin interface that allows the sending of a subject/topic change message)

and to existing interface IChatRoomContainer

IChatRoomAdminSender getChatRoomAdminSender();

I've also provided implementations:

IRCRootContainer:  returns null.
IRCChannelContainer:  returns IChatRoomAdminSender that sends a topic update to the appropriate channel

XMPPChatRoomContainer:  returns IChatRoomAdminSender that sends a subject update to the appropriate channel

There remains the implementation of some UI for sending the subject update message 
Comment 6 Remy Suen CLA 2007-09-07 10:30:08 EDT
I've added a @since tag to the interface.
Comment 7 Scott Lewis CLA 2007-09-07 11:10:42 EDT
(In reply to comment #6)
> I've added a @since tag to the interface.
> 

Thanks.
Comment 8 Remy Suen CLA 2007-09-12 13:48:47 EDT
I've added a read-only text field above the chat text fields that displays the subject. I'll leave it to an eager bug day participant to finish this bug off. :)
Comment 9 Jakub Jurkiewicz CLA 2007-09-20 09:59:02 EDT
(In reply to comment #8)
> I've added a read-only text field above the chat text fields that displays the
> subject. I'll leave it to an eager bug day participant to finish this bug off.
> :)
> 
Let's say the I'm the eager bug day participant ;) and I need some help.
I found where the code, which would update the topic field, should go, but I'm not sure how I should get the IChatRoomAdminSender instance.
In the class ChatRoomManagerView I have access to the instance of IRCRootContainer (the container filed in the mentioned class), but it returns null on invoking getChatRoomAdminSender();
I wonder how can I access instance of IRCChannelContainer, which would let me get the instance of IChatRoomAdminSender  on invoking getChatRoomAdminSender();?
Comment 10 Remy Suen CLA 2007-09-20 10:20:18 EDT
(In reply to comment #9)
> I wonder how can I access instance of IRCChannelContainer, which would let me
> get the instance of IChatRoomAdminSender  on invoking
> getChatRoomAdminSender();?

You can retrieve the SWT Text widget from the ChatRoomTab in ChatRoom class. Its constructor also takes in the IChatRoomContainer, so you can get the interface from there.
Comment 11 Jakub Jurkiewicz CLA 2007-09-20 17:57:14 EDT
(In reply to comment #10)
> 
> You can retrieve the SWT Text widget from the ChatRoomTab in ChatRoom class.
> Its constructor also takes in the IChatRoomContainer, so you can get the
> interface from there.

Yes, I know that. But when I try to invoke IChatRoomContainer#getChatRoomAdminSender on the instance of IChatRoomContainer, which is available there, I get null instead of instance of IChatRoomAdminSender. And this is beacause the IChatRoomContainer is the instance of IRCRootContainer and not IRCChannelContainer.

Comment 12 Remy Suen CLA 2007-09-20 18:08:15 EDT
(In reply to comment #11)
> But when I try to invoke
> IChatRoomContainer#getChatRoomAdminSender on the instance of
> IChatRoomContainer, which is available there, I get null instead of instance of
> IChatRoomAdminSender. And this is beacause the IChatRoomContainer is the
> instance of IRCRootContainer and not IRCChannelContainer.

I don't, I get an IRCChannelContainer. We're talking about the constructor at line 721 of the ChatRoomManagerView, yes?
Comment 13 Jakub Jurkiewicz CLA 2007-09-28 06:23:25 EDT
Created attachment 79363 [details]
Patch attachment

Thanks Remy for the tip.
I prepared a patch, but I'm not sure if I had used the simplest solution.
Looking forward for any comments.
Comment 14 Remy Suen CLA 2007-09-28 10:36:17 EDT
Committed to CVS HEAD with some slight adjustments. Thanks, Jakub.
Comment 15 Scott Lewis CLA 2008-05-18 19:26:38 EDT
closing