udayg / xmppwebchat

xmppwebchat
GNU Lesser General Public License v3.0
23 stars 14 forks source link

No user items are received #1

Closed sarht closed 10 years ago

sarht commented 10 years ago

Hi! I have integrated XMPPWebChat in another webapplikation. I have put the chat in an IFrame and just set the src to the application path on tomcat. I can login into the chat and I do receive the group part of the roster, but I don't receive any user items. I just get an empty bracket.

I connect to my local Tigase Server and I can see in the Tigase logs that the roster is indeed sent to the client as expected:

[in_9-c2s]         ConnectionManager.writePacketToSocket()  FINEST: c2s@fe-dell3010-1.flexite.local/192.168.0.55_5222_192.168.0.55_56055, type: accept, Socket: TLS: c2s@fe-dell3010-1.flexite.local/192.168.0.55_5222_192.168.0.55_56055 Socket[addr=/192.168.0.55,port=56055,localport=5222], jid: anna@fe-dell3010-1.flexite.local/Smack, Writing packet: from=sess-man@fe-dell3010-1.flexite.local, to=c2s@fe-dell3010-1.flexite.local/192.168.0.55_5222_192.168.0.55_56055, DATA=<iq type="set" id="tig4" xmlns="jabber:client" to="anna@fe-dell3010-1.flexite.local/Smack"><query xmlns="jabber:iq:roster"><item name="admin@fe-dell3010-1.flexite.local" subscription="both" jid="admin@fe-dell3010-1.flexite.local"><group>FE default group</group></item><item name="sarah@fe-dell3010-1.flexite.local" subscription="both" jid="sarah@fe-dell3010-1.flexite.local"><group>FE default group</group></item><item name="anna@fe-dell3010-1.flexite.local" subscription="both" jid="anna@fe-dell3010-1.flexite.local"><group>FE default group</group></item><item name="lisa@fe-dell3010-1.flexite.local" subscription="both" jid="lisa@fe-dell3010-1.flexite.local"><group>FE default group</group></item><item name="johan@fe-dell3010-1.flexite.local" subscription="both" jid="johan@fe-dell3010-1.flexite.local"><group>FE default group</group></item><item name="erik@fe-dell3010-1.flexite.local" subscription="both" jid="erik@fe-dell3010-1.flexite.local"><group>FE default group</group></item></query></iq>, SIZE=1000, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set

When I login into XMPPWebChat directly, outside my integrated webapplication I sometimes get the user items..

I have no problem when connecting to gmail.com. Then I always get my contacts.

Is there some way to enable logs to see what the server are returning to XMPPWebChat? Is it possible to enable tomcat logs to see what Tigase server are sending? Because cometd is managing the "receive from server" part I found it hard to track down the problem.

Any help is appreciated!

sarht commented 10 years ago

Ok I think I resolved the issue. My guess is that the roster didn't got time to be loaded. Shortly after connection.connect() the code makes a request for connection.getRoster(). In my case it seems that the server was too slow in returning the roster and then didn't got any entries when asking for them.

I put a Thread.sleep() just before getChatListener().init(connection) in XmppManager.java to make sure the server had time to return the roster. Not a very pretty solution but it will do for now. A isRosterLoaded() function in the Smack library had been nice!