powered by Jive Software

Reconnection and MultiUserChat

Hello,

I am using Smack library with a Spark client and I have found that after successful reconnections, every time I use the function *getOccupantsCount() *from a joined *MultiUserChat, *it gives me size 0 and I can’t either use getOccupants() because it is always empty. It happens when I start a new conference and when I am invited to one, and being joined to the room in both cases.

Anyone knows how can I retreive normal behavior of MultiUserChat variables after a successful reconnection? I can only achieve it login out my application.

Any idea?

Thanks in advance.

first :login and setupConnesetupctionLinstener

_xmppConnection.login(“user”,“pwd”);

_xmppConnection.addConnectionListener(onConnection) ;

… create multiUserChat room and join room

_multiUserChat.join(“room@conference.www”);

second: realization onConnection

ConnectionListener onConnection = new ConnectionListener(){

public void connectionClosed(){

//again login at this segment

login();

           setupConnesetupctionLinstener();

}

public void reconnectionSuccessful(){

_xmppConnection.disconnection();

}

…//省略

}

at this,you can restart openfire and you see, user logined and multiUserChat joined you define room now !!