Bug 192756 - [IRC] On channel join, get rid of 'entered' spam in
Summary: [IRC] On channel join, get rid of 'entered' spam in
Status: CLOSED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.providers (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 1.0.2   Edit
Assignee: ecf.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-06-14 17:38 EDT by Chris Aniszczyk CLA
Modified: 2007-08-05 16:12 EDT (History)
1 user (show)

See Also:


Attachments
Patch to add chat room preference page (8.66 KB, patch)
2007-07-27 13:24 EDT, Abner Ballardo CLA
no flags Details | Diff
org.eclipse.ecf.presence.ui.patch (12.42 KB, patch)
2007-07-27 18:02 EDT, Chris Aniszczyk CLA
no flags Details | Diff
mylyn/context/zip (1.11 KB, application/octet-stream)
2007-07-27 18:02 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-06-14 17:38:26 EDT
If you join a big channel, you get a ton of "xxx entered". I think on channel entry, we don't show these messages. We should show these messages in maybe the 'server tab', ie., irc.freenode.net, similar to how other IRC clients do it.
Comment 1 Abner Ballardo CLA 2007-07-22 13:52:48 EDT
I'm interested in working on this bug on Eclipse Bug Day (July 27 2007)
Comment 2 Chris Aniszczyk CLA 2007-07-22 15:40:38 EDT
Thanks Abner, I added you to the list of participants!

http://wiki.eclipse.org/BugDayJuly2007#Participants

Thank you very much!
Comment 3 Scott Lewis CLA 2007-07-22 20:04:59 EDT
Changing target milestone to 1.0.2.  If we can get this on bug day, we'll include in 1.0.2 the week following.  See http://wiki.eclipse.org/ECF_Ganymede_Roadmap
Comment 4 Abner Ballardo CLA 2007-07-26 15:51:43 EDT
I've found which method is invoked at the end of the first join [0], in this method all the presence listeners are fired [1]. I've also found where the presence listener was added [2], this listener invokes addParticipant method [3]  .

The addParticipant method adds an IUser to chatRoomParticipantViewer and prints the "xxx entered" message.

To avoid the spam message, I could change the code of addParticipant but I don't know if that could affect other plugins.

I haven't found a way to show the spam message in the 'server tab' without changing the code of ChatRoomManagerView class, but that could affect other plugins.

Could anyone help me please?

[0] org.eclipse.ecf.internal.provider.irc.container.IRCRootContainer.handle353Reply
[1] org.eclipse.ecf.internal.provider.irc.container.IRCChannelContainer.firePresenceListeners
[2] org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.doJoinRoom
[3] org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.ChatRoom.addParticipant
Comment 5 Scott Lewis CLA 2007-07-26 16:07:40 EDT
(In reply to comment #4)
> I've found which method is invoked at the end of the first join [0], in this
> method all the presence listeners are fired [1]. I've also found where the
> presence listener was added [2], this listener invokes addParticipant method
> [3]  .
> 
> The addParticipant method adds an IUser to chatRoomParticipantViewer and prints
> the "xxx entered" message.
> 
> To avoid the spam message, I could change the code of addParticipant but I
> don't know if that could affect other plugins.
> 
> I haven't found a way to show the spam message in the 'server tab' without
> changing the code of ChatRoomManagerView class, but that could affect other
> plugins.


> 
> Could anyone help me please?
> 
> [0]
> org.eclipse.ecf.internal.provider.irc.container.IRCRootContainer.handle353Reply
> [1]
> org.eclipse.ecf.internal.provider.irc.container.IRCChannelContainer.firePresenceListeners
> [2] org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.doJoinRoom
> [3]
> org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.ChatRoom.addParticipant
> 

I think that the change should be made in UI only...the ChatRoomManagerView.ChatRoom.addParticipant, which currently reads:

protected void addParticipant(IUser p) {
	if (p != null) {
		ID id = p.getID();
		if (id != null) {
// Here is where the text is printed out
			appendText(getOutputText(), new ChatLine(NLS.bind(
		Messages.ChatRoomManagerView_ENTERED_MESSAGE,getDateTime(), getUsernameFromID(id)), null));

// Here is where the participant is added to the viewer on left
			chatRoomParticipantViewer.add(p);
		}
	}
}

I think we should add a user preference for whether or not to display a text message for user entry (and exit btw...which is in removeParticipant).  Basically, have the line above changed like this:

// Here is where the text is printed out
			if (<preference is set>) appendText(getOutputText(), new ChatLine(NLS.bind(
		Messages.ChatRoomManagerView_ENTERED_MESSAGE,getDateTime(), getUsernameFromID(id)), null));


Then the message can be displayed if the user preference is on, and not displayed if off.  We can argue about default, but I would suggest default to off (no message/spam).

We do not yet have a chat room preferences page, however, so this will have to be added.  The preference page class should probably be in a new internal package in the org.eclipse.ecf.presence.ui plugin (package name:  org.eclipse.ecf.internal.presence.ui.preferences.





Comment 6 Jacek Pospychala CLA 2007-07-26 16:27:42 EDT
looks like it could be solved by .2 in  bug 197329#c4
but how to detect, when we've just logged into server, and not already in conversation.
Comment 7 Scott Lewis CLA 2007-07-26 16:53:05 EDT
(In reply to comment #6)
> looks like it could be solved by .2 in  bug 197329#c4

True, .2 in bug 197329#c4 could also solve it.  Basically have the equivalent of a callback for text output processing in addition to the command (text input) processing.  Certainly more general (supports lots of other text-only operations).

> but how to detect, when we've just logged into server, and not already in
> conversation.

I don't understand what you mean.  Why would it be necessary to detect ACTIONs without being in conversations?  (or am I misunderstanding what is being detected?)
Comment 8 Jacek Pospychala CLA 2007-07-26 17:17:17 EDT
I mean text that prints on login or channel join, catched by IRCRootContainer.(...).onReply().
How do we know, that OnReply we just received was caused by channel join, or login and that it should be stripped of.

Ok, i see reply is generated in answer to user command, so it's possible, but someone should remember what was that command, so eventual renderer would have to know the context, not a single message.
Comment 9 Abner Ballardo CLA 2007-07-27 13:24:49 EDT
Created attachment 74813 [details]
Patch to add chat room preference page

Adding a new preference page in Collaboration category where you can enable or disable the user entry/exit messages.
Comment 10 Chris Aniszczyk CLA 2007-07-27 18:02:22 EDT
committed to HEAD. Refactored some of the strings.

Looks great!
Comment 11 Chris Aniszczyk CLA 2007-07-27 18:02:43 EDT
Created attachment 74841 [details]
org.eclipse.ecf.presence.ui.patch
Comment 12 Chris Aniszczyk CLA 2007-07-27 18:02:47 EDT
Created attachment 74842 [details]
mylyn/context/zip
Comment 13 Chris Aniszczyk CLA 2007-07-27 18:03:15 EDT
done.
Comment 14 Abner Ballardo CLA 2007-07-28 00:44:33 EDT
(In reply to comment #13)
> done.
> 

Chris, in your patch, there's a definition of PresenceHyperlinkDetector in plugin.xml but there isn't a org.eclipse.ecf.internal.presence.ui.hyperlink.PresenceHyperlinkDetector class.
Comment 15 Chris Aniszczyk CLA 2007-07-28 00:50:33 EDT
My mistake, Mylyn didn't help me out here. I removed the bogus reference, that code isn't ready to be checked in yet.
Comment 16 Scott Lewis CLA 2007-08-05 16:12:01 EDT
Added to IP log.  Closing.  Thanks Abner for the contribution.