Have a problem with agsXMPP. What I want to do, is connect to openfire server as "User1" (as example), check which users in my roster are online and return collection of ONLINE usernames. The problem is, that OnPresence event is the last event (based on my research), and it occures for each online user. But how can I know when it has finished checking all the online users, so I could finally return my ONLINE collection? Is there something like OnPresenceEnd event?
Please help!
no there is nothing like that. The xmpp server sends every presence in its own stanza. And there is nothing in the XMPP protocol which would tell you that all initial presences are received now.
XMPP is an asynchronous protocol. When possible keep your code also asynchronous and update the presence after each OnPresence event.