powered by Jive Software

Doesn't work muc.getOccupants() in 4.0.0-rc1

MultiUserChat muc = new MultiUserChat(connection, room);
List occu = muc.getOccupants();

muc has null size of the occupantsMap.


method “init()”


row 1987:

Presence oldPresence = occupantsMap.put(from, presence);

This code doesn’t assign the values of the occupantsMap.

occupantsMap is not null, but oldPresence after this code is null.

I’m sorry I can’t follow. What exactly is wrong in the packetListener for MUC presence updates? What would be your proposed solution?

I’m sorry. It was wrong approval that erorr in “Presence oldPresence = occupantsMap.put(from, presence);”.

I need more time for debug…

In one of the steps of initializations “occupantsMap” is rewriting by null

I don’t know why but after reading packet MultiUserChat is recreating that why occupantsMap is empty

after row 2034 it went to class PacketMultiplexListener in method “processPacket” . This method starts again “presenceListener”

When it all returns in MultiUserChat class - occupantsMap recreating

I’m sorry I can’t still follow. occupantsMap is only cleared if the room is left or the user is kicked. I’m still unable to grasp what you are trying to tell me.

it’s easy to check.

just execute “muc.getOccupants()

Is it works?

I guess this may because you are using new MultiUserChat to get an instance each time, as i made this mistake before. try just new once and reuse this instance afterward.

It might also be related to this issue, which I’ve described here:

Thanks, I jusf have tried it once and it works