Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 183192

Summary: [presence] IChatRoomContainer needs to allow the sending of private messages
Product: [RT] ECF Reporter: Remy Suen <remy.suen>
Component: ecf.coreAssignee: ecf.core-inbox <ecf.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: slewis
Version: 1.0.0 Release   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 182601    
Attachments:
Description Flags
Proposed patch to have IRCRootContainer propagate the private IMs to other channels. none

Description Remy Suen CLA 2007-04-19 10:07:18 EDT
IChatRoomContainer only allows for the sending of a message to the chatroom. We should provide an API to allow a user to send private messages to each other. I presume it's good enough if we just add a getChatMessageSender() that returns an IChatMessageSender interface.
Comment 1 Scott Lewis CLA 2007-04-19 13:00:12 EDT
(In reply to comment #0)
> IChatRoomContainer only allows for the sending of a message to the chatroom. We
> should provide an API to allow a user to send private messages to each other. I
> presume it's good enough if we just add a getChatMessageSender() that returns
> an IChatMessageSender interface.
> 

Here's a suggested API addition:

In IChatRoomContainer

// Sender
public IChatMessageSender getPrivateMessageSender();

// Receiver
The existing IIMMessageListener (added via IChatRoomContainer.addMessageListener()) can then handle IChatMessageEvent instances (as well as IChatRoomMessageEvent) instances.


Comment 2 Remy Suen CLA 2007-04-19 14:30:04 EDT
Was working on a patch to implement the above when I realized that would you then not necessarily have to synchronize the IIMMessageListeners on both the IChatManager and the IChatRoomContainer? :(
Comment 3 Remy Suen CLA 2007-05-25 07:12:33 EDT
Scott, what do you think about the issue described in comment #3?

I guess the underlying implementation would have to share its collection/array of IIMMessageListeners across all of its IChatManagers and IChatRoomContainers?
Comment 4 Scott Lewis CLA 2007-05-25 11:39:12 EDT
(In reply to comment #3)
> Scott, what do you think about the issue described in comment #3?
> 
> I guess the underlying implementation would have to share its collection/array
> of IIMMessageListeners across all of its IChatManagers and IChatRoomContainers?
> 

I don't see the problem of synchronization...i.e. if the notification is synchronizing on the list (which it typically is) then this should be enough (does need to be one list of course).  

RE: sharing the IIMMessageListener with IChatManager and IChatRoomContainers...yes, but there's typically a back ref to the IConIPresenceContainerAdapter in these anyway...but couldn't they just call back on methods for event distribution to listeners on IPresenceContainerAdapter?
Comment 5 Remy Suen CLA 2007-05-25 11:49:58 EDT
(In reply to comment #4)
> RE: sharing the IIMMessageListener with IChatManager and
> IChatRoomContainers...yes, but there's typically a back ref to the
> IConIPresenceContainerAdapter in these anyway...but couldn't they just call
> back on methods for event distribution to listeners on
> IPresenceContainerAdapter?

Probably. I'll try to take a look tonight / this weekend.
Comment 6 Remy Suen CLA 2007-05-26 08:58:02 EDT
Created attachment 68857 [details]
Proposed patch to have IRCRootContainer propagate the private IMs to other channels.

Are you talking about something like this?
Comment 7 Scott Lewis CLA 2007-05-26 12:14:55 EDT
(In reply to comment #6)
> Created an attachment (id=68857) [details]
> Proposed patch to have IRCRootContainer propagate the private IMs to other
> channels.
> 
> Are you talking about something like this?
> 

I suppose.  Does this create a synchronization or other problem in the IRC impl?


Comment 8 Remy Suen CLA 2007-05-26 12:30:19 EDT
(In reply to comment #7)
> I suppose.  Does this create a synchronization or other problem in the IRC
> impl?

I don't think so. They're ArrayLists anyway so they're not synchronized.
Comment 9 Remy Suen CLA 2007-05-26 12:58:00 EDT
Committed to CVS HEAD.
Comment 10 Scott Lewis CLA 2008-05-18 19:04:14 EDT
closing.