powered by Jive Software

Getting GroupChat Participants

Hi

i don’‘t get what’'s going on…

is there any bug reporet about problems getting the participants of a GroupChat

I was having problems with it so i took away a packetListener wich should get offline messages and it worked fine untill a couple of minutes ago… then i camed in JDev and i got only 3 users… i tryed again and added a System.out.println for each Participant… but i got the same 3…

By the way… i don’'t get the debug window… i setted con.debug=true; and put it in all possible orders (before connecting, after that, before i switch on my pc ) but i get no debug Window… any Idea about it?

thanks

Nicolas

Nicolas,

I don’'t understand the issue. Is the count incorrect?

Regards,

Matt

The problem is i’'m asking for participants before i got all of them

once my connections presenceChanged event happens the Participant list is ok

I tryed using myGroupChat.isJoined() but it returns true before all Participants are recived

I could use wait(n) but i guess there is a better way to know when all Participant Info is allready recived

(I finally got the DebugWindow working)

thanks

Nicolas

There is no way for Smack to know when the full list has been sent by the server. Instead, you should add a participant listener so that you can know when users join or leave the room using:

GroupChat.addParticipantListener

The XMPP protocol is asynchronous in nature, so there is only so much we can do in the Smack API to make it appear synchronous. Basically, that means that methods that returns counts or lists might return different results each time you call them as more data is received.

Regards,

Matt

matt… i had allready added it… somehow i was lossing my first participant list

so i added a call to updateUsers…

it seems to work fine by now

thanks

Nicolas