File tree Expand file tree Collapse file tree
src/main/java/org/buddycloud/channelserver/utils/users Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,26 +61,32 @@ public void subscribeToNodeListeners(BlockingQueue<Packet> outQueue) {
6161 }
6262
6363 public ArrayList <JID > getResources (JID jid ) throws NodeStoreException {
64- if ((jid .getResource () != null )
65- || ((jid .getResource () == null ) && (jid .getNode () == null ))) {
66- ArrayList <JID > user = new ArrayList <JID >();
64+
65+ boolean isBareJid = (jid .getResource () == null );
66+ boolean isServerJid = ((jid .getResource () == null ) && (jid .getNode () == null ));
67+
68+ String bareJid = jid .toBareJID ();
69+
70+ ArrayList <JID > user = new ArrayList <JID >();
71+ if (!isBareJid || isServerJid ) {
6772 user .add (jid );
6873 return user ;
6974 }
75+
7076 if (true == useDatabaseStorage ) {
71- ArrayList < JID > jids = channelManager .onlineJids (jid );
77+ return channelManager .onlineJids (jid );
7278 }
73- if (! users .containsKey (jid . toBareJID () )) {
74- return new ArrayList < JID >( );
79+ if (users .containsKey (bareJid )) {
80+ return users . get ( bareJid );
7581 }
76- return users . get ( jid . toBareJID ()) ;
82+ return user ;
7783 }
7884
7985 public void updateStatus (JID jid , String type ) throws NodeStoreException {
8086 if (!LocalDomainChecker .isLocal (jid .getDomain (), configuration )) {
8187 return ;
8288 }
83-
89+
8490 ArrayList <JID > user = null ;
8591 if (users .containsKey (jid .toBareJID ())) {
8692 user = users .get (jid .toBareJID ());
You can’t perform that action at this time.
0 commit comments