Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 77538 Details for
Bug 149912
[IRC] Name changes are not detected internally
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
patch.txt (text/plain), 10.89 KB, created by
Jacek Pospychala
on 2007-09-02 10:28:04 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2007-09-02 10:28:04 EDT
Size:
10.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.provider.irc >Index: src/org/eclipse/ecf/internal/provider/irc/container/IRCRootContainer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.provider.irc/src/org/eclipse/ecf/internal/provider/irc/container/IRCRootContainer.java,v >retrieving revision 1.21 >diff -u -r1.21 IRCRootContainer.java >--- src/org/eclipse/ecf/internal/provider/irc/container/IRCRootContainer.java 2 Sep 2007 07:15:02 -0000 1.21 >+++ src/org/eclipse/ecf/internal/provider/irc/container/IRCRootContainer.java 2 Sep 2007 14:26:05 -0000 >@@ -261,13 +261,13 @@ > channel > .fireContainerEvent(new ContainerDisconnectingEvent( > channel.getID(), channel.targetID)); >- channel.firePresenceListeners(false, >+ channel.firePresenceListeners(IRCChannelContainer.LEAVE_EVENT, > new String[] { kicked }); > channel > .fireContainerEvent(new ContainerDisconnectedEvent( > channel.getID(), channel.targetID)); > } else { >- channel.firePresenceListeners(false, >+ channel.firePresenceListeners(IRCChannelContainer.LEAVE_EVENT, > new String[] { kicked }); > } > } >@@ -281,8 +281,15 @@ > trace("handleOnMode(" + arg0 + "," + arg1 + "," + arg2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > >- public void onNick(IRCUser arg0, String arg1) { >- trace("handleOnNick(" + arg0 + "," + arg1 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ public void onNick(IRCUser user, String newnick) { >+ trace("handleOnNick(" + user + "," + newnick + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ >+ String[] nick = new String[] { user.getNick(), newnick }; >+ >+ for (Iterator i = channels.values().iterator(); i.hasNext();) { >+ IRCChannelContainer c = (IRCChannelContainer) i.next(); >+ c.firePresenceListeners(IRCChannelContainer.NICK_EVENT, nick); >+ } > } > > public void onNotice(String arg0, IRCUser arg1, String arg2) { >@@ -295,7 +302,7 @@ > IRCChannelContainer channel = (IRCChannelContainer) channels > .get(arg0); > if (channel != null) { >- channel.firePresenceListeners(false, >+ channel.firePresenceListeners(IRCChannelContainer.LEAVE_EVENT, > new String[] { getIRCUserName(arg1) }); > } > } >@@ -816,7 +823,7 @@ > showMessage(null, NLS.bind(Messages.IRCRootContainer_353_Error, > channel)); > } else >- container.firePresenceListeners(true, strings); >+ container.firePresenceListeners(IRCChannelContainer.JOIN_EVENT, strings); > } > > protected class ReplyHandler { >Index: src/org/eclipse/ecf/internal/provider/irc/container/IRCChannelContainer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.provider.irc/src/org/eclipse/ecf/internal/provider/irc/container/IRCChannelContainer.java,v >retrieving revision 1.12 >diff -u -r1.12 IRCChannelContainer.java >--- src/org/eclipse/ecf/internal/provider/irc/container/IRCChannelContainer.java 2 Sep 2007 07:15:02 -0000 1.12 >+++ src/org/eclipse/ecf/internal/provider/irc/container/IRCChannelContainer.java 2 Sep 2007 14:26:00 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Composent, Inc. - initial API and implementation >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 149912 > *****************************************************************************/ > package org.eclipse.ecf.internal.provider.irc.container; > >@@ -28,6 +29,7 @@ > import org.eclipse.ecf.core.identity.Namespace; > import org.eclipse.ecf.core.identity.StringID; > import org.eclipse.ecf.core.security.IConnectContext; >+import org.eclipse.ecf.core.user.IUser; > import org.eclipse.ecf.core.user.User; > import org.eclipse.ecf.core.util.ECFException; > import org.eclipse.ecf.core.util.TimeoutException; >@@ -49,6 +51,12 @@ > > private static final long CONNECT_TIMEOUT = 10000; > >+ protected static final int JOIN_EVENT = 1; >+ >+ protected static final int LEAVE_EVENT = 2; >+ >+ protected static final int NICK_EVENT = 3; >+ > protected List participantListeners = new ArrayList(); > protected IRCRootContainer rootContainer; > protected IRCUser ircUser = null; >@@ -88,7 +96,7 @@ > > protected void handleUserQuit(String name) { > if (containsChannelParticipant(createIDFromString(name)) != null) >- firePresenceListeners(false, new String[] { name }); >+ firePresenceListeners(LEAVE_EVENT, new String[] { name }); > } > > private IPresence createPresence(final boolean available) { >@@ -153,9 +161,20 @@ > return null; > } > >- protected void firePresenceListeners(boolean joined, String[] users) { >+ /** >+ * Fires presence change events. >+ * >+ * {@link #JOIN_EVENT} indicates new users on channel. >+ * {@link #LEAVE_EVENT} indicates users leaving channel. >+ * {@link #NICK_EVENT} indicates users changing their names. users array contains pairs >+ * of old and new nicknames. >+ * >+ * @param event either one of {@link #JOIN_EVENT}, {@link #LEAVE_EVENT} or {@link #NICK_EVENT}. >+ * @param users users that have changed. >+ */ >+ protected void firePresenceListeners(int event, String[] users) { > for (int j = 0; j < users.length; j++) { >- if (joined) { >+ if (event == JOIN_EVENT) { > if (isChannelOperator(users[j])) > setChannelOperator(users[j]); > ID participantID = createIDFromString(users[j]); >@@ -170,7 +189,7 @@ > l.handlePresenceUpdated(participantID, createPresence(true)); > } > } >- } else { >+ } else if (event == LEAVE_EVENT) { > ID removeID = removeChannelParticipant(createIDFromString(users[j])); > if (removeID != null) { > // Notify all listeners >@@ -184,6 +203,27 @@ > } > > } >+ } else if (event == NICK_EVENT) { >+ if (isChannelOperator(users[j])) >+ setChannelOperator(users[j]); >+ ID userID = removeChannelParticipant(createIDFromString(users[j])); >+ ID addID = createIDFromString(users[j+1]); >+ >+ if ((userID != null) && (addChannelParticipant(addID))) { >+ for (Iterator i = participantListeners.iterator(); i.hasNext();) { >+ IChatRoomParticipantListener l = (IChatRoomParticipantListener) i.next(); >+ >+ IUser user = new User(userID); >+ IUser newNickname = new User(addID); >+ if (isChannelOperator(users[j])) >+ setChannelOperator(users[j]); >+ >+ l.handleArrived(user); >+ l.handleUpdated(newNickname); >+ } >+ } >+ >+ j++; > } > } > } >@@ -217,7 +257,7 @@ > } > } > } else >- firePresenceListeners(true, new String[] { getIRCUserName(user) }); >+ firePresenceListeners(JOIN_EVENT, new String[] { getIRCUserName(user) }); > } > > protected void fireContainerEvent(IContainerEvent event) { >#P org.eclipse.ecf.presence.ui >Index: src/org/eclipse/ecf/internal/presence/ui/Messages.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java,v >retrieving revision 1.25 >diff -u -r1.25 Messages.java >--- src/org/eclipse/ecf/internal/presence/ui/Messages.java 2 Sep 2007 12:24:21 -0000 1.25 >+++ src/org/eclipse/ecf/internal/presence/ui/Messages.java 2 Sep 2007 14:26:08 -0000 >@@ -17,7 +17,7 @@ > public class Messages extends NLS { > > private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.presence.ui.messages"; //$NON-NLS-1$ >- >+ > public static String ChangePasswordDialog_1; > > public static String ChangePasswordDialog_CHANGE_PASSWORD; >@@ -68,6 +68,8 @@ > public static String ChatRoomManagerView_ENTERED_MESSAGE; > > public static String ChatRoomManagerView_LEFT_MESSAGE; >+ >+ public static String ChatRoomManagerView_NICKCHANGE_MESSAGE; > > public static String ChatRoomManagerView_JOIN_COMMAND; > >Index: src/org/eclipse/ecf/internal/presence/ui/messages.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties,v >retrieving revision 1.27 >diff -u -r1.27 messages.properties >--- src/org/eclipse/ecf/internal/presence/ui/messages.properties 2 Sep 2007 12:24:21 -0000 1.27 >+++ src/org/eclipse/ecf/internal/presence/ui/messages.properties 2 Sep 2007 14:26:08 -0000 >@@ -114,6 +114,7 @@ > ChatRoomManagerView_USERS_IN_CHAT_ROOM = {0} users > ChatRoomView_NOT_CONNECTED_MESSAGE=Not connected to chat room > ChatRoomManagerView_LEFT_MESSAGE={0} left >+ChatRoomManagerView_NICKCHANGE_MESSAGE={0} is now known as {1} > ChangePasswordDialog_CHANGE_PASSWORD=Change Password > ChatRoomManagerView_MESSAGE={0}: {1}\n > ChatRoomView_TIME_FORMAT=HH:mm:ss >Index: src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java,v >retrieving revision 1.32 >diff -u -r1.32 ChatRoomManagerView.java >--- src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 2 Sep 2007 12:45:11 -0000 1.32 >+++ src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 2 Sep 2007 14:26:14 -0000 >@@ -555,17 +555,22 @@ > }); > // setup participant listener > chatRoomContainer.addChatRoomParticipantListener(new IChatRoomParticipantListener() { >+ IUser participant; >+ > public void handlePresenceUpdated(ID fromID, IPresence presence) { > chatroom.handlePresence(fromID, presence); > } > >- public void handleArrived(IUser participant) { >+ public void handleArrived(IUser p) { >+ this.participant = p; > } > > public void handleUpdated(IUser updatedParticipant) { >+ chatroom.renameParticipant(participant, updatedParticipant); > } > >- public void handleDeparted(IUser participant) { >+ public void handleDeparted(IUser p) { >+ // > } > }); > chatRoomContainer.addListener(new IContainerListener() { >@@ -1009,6 +1014,24 @@ > } > } > >+ protected void renameParticipant(final IUser oldUser, final IUser newUser) { >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ if (oldUser != null) { >+ ID id = oldUser.getID(); >+ if (id != null) { >+ >+ ChatRoomParticipant p = new ChatRoomParticipant(id); >+ >+ appendText(chatRoomTab, getOutputText(), new ChatLine(NLS.bind(Messages.ChatRoomManagerView_NICKCHANGE_MESSAGE, getUsernameFromID(id), getUsernameFromID(newUser.getID())), null)); >+ chatRoomParticipantViewer.remove(p); >+ chatRoomParticipantViewer.add(new ChatRoomParticipant(newUser.getID())); >+ } >+ } >+ } >+ }); >+ } >+ > protected void removeAllParticipants() { > Table t = chatRoomParticipantViewer.getTable(); > for (int i = 0; i < t.getItemCount(); i++) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 149912
:
74811
| 77538