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,33 @@ 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+ JID bareJid = new JID (jid .toBareJID ());
69+
70+ ArrayList <JID > user = new ArrayList <JID >();
71+
72+ if (!isBareJid || isServerJid ) {
6773 user .add (jid );
6874 return user ;
6975 }
76+
7077 if (true == useDatabaseStorage ) {
71- ArrayList < JID > jids = channelManager .onlineJids (jid );
78+ return channelManager .onlineJids (jid );
7279 }
73- if (! users .containsKey (jid . toBareJID () )) {
74- return new ArrayList < JID >( );
80+ if (users .containsKey (bareJid )) {
81+ return users . get ( bareJid );
7582 }
76- return users . get ( jid . toBareJID ()) ;
83+ return user ;
7784 }
7885
7986 public void updateStatus (JID jid , String type ) throws NodeStoreException {
8087 if (!LocalDomainChecker .isLocal (jid .getDomain (), configuration )) {
8188 return ;
8289 }
83-
90+
8491 ArrayList <JID > user = null ;
8592 if (users .containsKey (jid .toBareJID ())) {
8693 user = users .get (jid .toBareJID ());
You can’t perform that action at this time.
0 commit comments