From 649483d3fd4eb2a1df09b30df271b2f3b8d1053f Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Tue, 7 Jan 2014 13:04:24 -0600 Subject: [PATCH] Issue #2563 fixed room id creation room ids were being generated with the hostname used to connect to the server they needed to be generated with what the server calls itself Former-commit-id: 82716fa1474885fe1166f48a4fa2e943ebbdee7a [formerly 99fb102b270baa5c45f1c9963f47344ede93a34a] Former-commit-id: 66df912a4e794a2b98d6ad07561df978c7767fe5 --- .../collaboration/comm/provider/session/AccountManager.java | 5 +++-- .../comm/provider/session/CollaborationConnection.java | 4 +++- .../collaboration/comm/provider/session/VenueSession.java | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/AccountManager.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/AccountManager.java index 64ffa8308a..76671ee933 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/AccountManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/AccountManager.java @@ -37,6 +37,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.ISession; import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession; import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionResponder; import com.raytheon.uf.viz.collaboration.comm.provider.event.UserPresenceChangedEvent; +import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** @@ -56,6 +57,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; * ------------ ---------- ----------- -------------------------- * Mar 16, 2012 jkorman Initial creation * Dec 6, 2013 2561 bclement removed ECF + * Jan 07, 2013 2563 bclement fixed id parsing in auto responder * * * @@ -77,8 +79,7 @@ public class AccountManager implements IAccountManager { if (type == null) { return; } - UserId fromId = new UserId(pres.getFrom(), sessionManager - .getXmppConnection().getHost()); + UserId fromId = IDConverter.convertFrom(pres.getFrom()); switch (type) { case subscribe: handleSubRequest(fromId); diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/CollaborationConnection.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/CollaborationConnection.java index d47b314e19..0cc9b8f8c1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/CollaborationConnection.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/CollaborationConnection.java @@ -106,6 +106,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId; * Dec 18, 2013 2562 bclement added smack compression, fixed invite parsing * Dec 19, 2013 2563 bclement added connection listener, * added better error message on failed connection + * Jan 07, 2013 2563 bclement use getServiceName instead of getHost when creating room id * * * @@ -452,7 +453,8 @@ public class CollaborationConnection implements IEventPublisher { * @return false on error */ public boolean venueExistsOnServer(String venueName) { - String roomId = VenueSession.getRoomId(connection.getHost(), venueName); + String roomId = VenueSession.getRoomId(connection.getServiceName(), + venueName); try { return VenueSession.roomExistsOnServer(connection, roomId); } catch (XMPPException e) { diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java index 393367c975..07b9460a5e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java @@ -87,6 +87,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; * Dec 6, 2013 2561 bclement removed ECF * Dec 18, 2013 2562 bclement moved data to packet extension * Dec 19, 2013 2563 bclement status listeners now send all events to bus + * Jan 07, 2013 2563 bclement use getServiceName instead of getHost when creating room id * * * @@ -255,7 +256,7 @@ public class VenueSession extends BaseSession implements IVenueSession { throws CollaborationException { CollaborationConnection manager = getSessionManager(); XMPPConnection conn = manager.getXmppConnection(); - String roomId = getRoomId(conn.getHost(), venueName); + String roomId = getRoomId(conn.getServiceName(), venueName); this.muc = new MultiUserChat(conn, roomId); this.venue = new Venue(conn, muc); createListeners(); @@ -287,7 +288,7 @@ public class VenueSession extends BaseSession implements IVenueSession { try { CollaborationConnection manager = getSessionManager(); XMPPConnection conn = manager.getXmppConnection(); - String roomId = getRoomId(conn.getHost(), venueName); + String roomId = getRoomId(conn.getServiceName(), venueName); if (roomExistsOnServer(conn, roomId)) { throw new CollaborationException("Session name already in use"); }