Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-10-29 19:33:51 -0400
committerslewis2008-10-29 19:33:51 -0400
commita6af2c1ddbebf9e0aa9e16cc1659d1989138f406 (patch)
tree1133ddcf5474acc14b1cc7a203751f3294583e14 /providers/bundles/org.eclipse.ecf.provider.xmpp
parent83cdba103ddc0fe4a89fa1e089d702b0c456c2b8 (diff)
downloadorg.eclipse.ecf-a6af2c1ddbebf9e0aa9e16cc1659d1989138f406.tar.gz
org.eclipse.ecf-a6af2c1ddbebf9e0aa9e16cc1659d1989138f406.tar.xz
org.eclipse.ecf-a6af2c1ddbebf9e0aa9e16cc1659d1989138f406.zip
Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=246155
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.xmpp')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/XMPPContainerPresenceHelper.java17
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java9
2 files changed, 21 insertions, 5 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/XMPPContainerPresenceHelper.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/XMPPContainerPresenceHelper.java
index b3a8aa12d..aa80ff7a3 100644
--- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/XMPPContainerPresenceHelper.java
+++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/XMPPContainerPresenceHelper.java
@@ -37,6 +37,7 @@ import org.eclipse.ecf.internal.provider.xmpp.events.IQEvent;
import org.eclipse.ecf.internal.provider.xmpp.events.MessageEvent;
import org.eclipse.ecf.internal.provider.xmpp.events.PresenceEvent;
import org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection;
+import org.eclipse.ecf.presence.IFQID;
import org.eclipse.ecf.presence.IPresence;
import org.eclipse.ecf.presence.IPresenceListener;
import org.eclipse.ecf.presence.IPresenceSender;
@@ -520,9 +521,23 @@ public class XMPPContainerPresenceHelper implements ISharedObject {
}
}
+ private void updateXMPPID(XMPPID newID, XMPPID oldID) {
+ String newResource = newID.getResourceName();
+ String oldResource = oldID.getResourceName();
+ if (oldResource == null) {
+ oldID.setResourceName(newResource);
+ } else {
+ if (newResource != null && (oldResource.compareTo(newResource) < 0)) {
+ oldID.setResourceName(newResource);
+ }
+ }
+ }
+
private void updatePresenceForMatchingEntry(org.eclipse.ecf.presence.roster.RosterEntry entry, XMPPID fromID, IPresence newPresence) {
final IUser user = entry.getUser();
- if (fromID.equals(user.getID())) {
+ ID oldID = user.getID();
+ if (fromID.equals(oldID)) {
+ if (oldID instanceof XMPPID) updateXMPPID(fromID,(XMPPID) oldID);
entry.setPresence(newPresence);
rosterManager.notifyRosterUpdate(entry);
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
index 8fff5cd6c..8c2302084 100644
--- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
+++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
@@ -125,13 +125,13 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
if (atIndex != -1) {
if (hostname == null)
hostname = remainder.substring(0, atIndex);
- resourcename = PATH_DELIMITER + remainder.substring(atIndex + 1);
+ setResourceName(remainder.substring(atIndex + 1));
} else {
- resourcename = PATH_DELIMITER + "";
+ setResourceName(null);
}
if (hostname == null)
hostname = remainder;
- uri = new URI(namespace.getScheme(), username, hostname, port, resourcename, null, null);
+ uri = new URI(namespace.getScheme(), username, hostname, port, PATH_DELIMITER + ((resourcename==null)?"":resourcename), null, null);
}
protected int namespaceCompareTo(BaseID o) {
@@ -190,7 +190,8 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
}
public String getFQName() {
- return getUsernameAtHost() + getResourceName();
+ String rn = getResourceName();
+ return getUsernameAtHost() + PATH_DELIMITER + ((rn==null)?"":rn);
}
public String toString() {

Back to the top