Problems with MultiUserChat, UserStatusListener and the "kick" messages

Hello everybody,

I am currently working on a Jabber Client using the Jive Smack API and I have some difficulties with the MultiUserChat…

When I use the “kickParticipant” method, I have stranges results with the kicked entry.

Every other participants of the MultiUserChat normally see the ParticipantStatusListener - kicked event.

But the kicked participant get a Null PointerException, even if he has not registered a UserStatusListener.

Here is the Stack trace generated :

java.lang.NullPointerException

at org.jivesoftware.smackx.muc.MultiUserChat.fireUserStatusListeners(MultiUserChat .java:1940)

at org.jivesoftware.smackx.muc.MultiUserChat.checkPresenceCode(MultiUserChat.java: 2352)

at org.jivesoftware.smackx.muc.MultiUserChat.access$10(MultiUserChat.java:2339)

at org.jivesoftware.smackx.muc.MultiUserChat$8.processPacket(MultiUserChat.java:20 97)

at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader .java:576)

at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:231)

at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:43)

at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:71)

I’'ve examinated the MultiUserChat sourcecode and as it seems, this is due to the call of “mucUser.getItem().getActor()” on line 2352 of MultiUserChat (release 1.5) which return null.

So I am wondering If I made something wrong (I hope I have encountered a “common” mistake) or if I happily discovered some kind of bug…

A little help would be greatly appreciated (as I am getting mad with this), thank you.

Snybril

Well, as it seem I cannot catch the event using a custom packet listener. (with a filter on Packet Extention : MUC#User)

This is rather strange and very annoying, any idea of what I can do ?

Hey Snybril,

Could you open a Smack debugger and check what the server is sending to Smack? As you said, my guess is that the server is not sending the bare JID of the user who initiated the kick. My interpretation of the spec is that the actor should be included in the presence. BTW, which server are you using?

Regards,

– Gato

Hello, thanks for your help,

here is the stanza thrown by the server (toto is of course the kicked one) :

As it seems, you are definitely right, the server does not send the id of the kicker.

Sadly I have no handle on the jabber server.

I will made a few modifications to the MultiUserChat code to avoid this null pointer exception.

Hey Snybril,

I just checked in a fix for this problem. So even if the server didn’‘t send an actor then Smack won’'t throw an exception. The bug fix will be available with the next nightly build.

Let me know how it goes.

Regards,

– Gato