Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-05-12 18:42:48 -0400
committerslewis2009-05-12 18:42:48 -0400
commit9b1a55289a21195ebca1729ddf7b206526242b78 (patch)
tree078ca443328ab19cc126fb5fc0320ea109ccd7ba /providers/bundles/org.eclipse.ecf.provider.xmpp
parent77303a0aaf183f164a398a4c079885169b63c07f (diff)
downloadorg.eclipse.ecf-9b1a55289a21195ebca1729ddf7b206526242b78.tar.gz
org.eclipse.ecf-9b1a55289a21195ebca1729ddf7b206526242b78.tar.xz
org.eclipse.ecf-9b1a55289a21195ebca1729ddf7b206526242b78.zip
Fixes for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=237723
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/smack/ECFConnection.java17
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java14
2 files changed, 16 insertions, 15 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/smack/ECFConnection.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/smack/ECFConnection.java
index 0d53b123c..64349bdee 100644
--- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/smack/ECFConnection.java
+++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/internal/provider/xmpp/smack/ECFConnection.java
@@ -142,14 +142,14 @@ public class ECFConnection implements ISynchAsynchConnection {
final XMPPID jabberURI = getXMPPID(remote);
- String username = jabberURI.getUsername();
+ String username = jabberURI.getNodename();
String hostname = jabberURI.getHostname();
String hostnameOverride = null;
- // Check for the URI form of "joe@bloggs.org@talk.google.com", which
+ // Check for the URI form of "joe@bloggs.org;talk.google.com", which
// would at this point would have
- // - username = "joe@bloggs.org"
- // - hostname = "talk.google.com"
+ // - username = "joe"
+ // - hostname = "blogs.org;talk.google.com"
// - hostnameOverride = null
//
// We need to turn this into:
@@ -157,11 +157,10 @@ public class ECFConnection implements ISynchAsynchConnection {
// - hostname = "bloggs.org"
// - hostnameOverride = "talk.google.com"
- int atSignIdx = username.lastIndexOf('@');
- if (atSignIdx != -1) {
- hostnameOverride = hostname;
- hostname = username.substring(atSignIdx + 1);
- username = username.substring(0, atSignIdx);
+ int semiColonIdx = hostname.lastIndexOf(';');
+ if (semiColonIdx != -1) {
+ hostnameOverride = hostname.substring(semiColonIdx + 1);
+ hostname = hostname.substring(0, semiColonIdx);
}
if (google && hostnameOverride == null) {
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 538d6c596..8daabf257 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
@@ -200,12 +200,14 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
}
public String getUsernameAtHost() {
- // if we use the full "user@domain@server" format, detect that here
- if (getUsername().indexOf(USER_HOST_DELIMITER) != -1)
- return getUsername();
- else
- return getUsername() + USER_HOST_DELIMITER + getHostname()
- + ((getPort() == -1) ? "" : ":" + getPort());
+ String username = getUsername();
+ String hostname = getHostname();
+ int semiColonIdx = hostname.indexOf(';');
+ if (semiColonIdx != -1) {
+ hostname = hostname.substring(0, semiColonIdx);
+ }
+ return username + USER_HOST_DELIMITER + hostname
+ + ((getPort() == -1) ? "" : ":" + getPort());
}
public String getFQName() {

Back to the top