powered by Jive Software

MultiUserChat - privateChat MessageListeners are not fired

Hello,

When using Smack to participate in a private chat within a MultiUserChat room, my MessageListener is never triggered.

When using the packetListener on the connection, I see the message-stanzas arriving fine, without errors. That means that I’m able to filter the incoming messages from within my packetlistener, but that way, I can only have one global messagelistener per connection, instead of a MessageListener per Chat instance.

How I (think I should) do Muc with PrivateChat:

//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////

XMPPConnection connection;

MultiUserChat muc = new MultiUserChat(connection, “roomname[AT]conference.domain.com”);

muc.join(“myNickname”);

Chat chat = muc.createPrivateChat(“you[AT]domain.com”, new MessageListener(){

public void processMessage(Chat chat, Message message) {

//WE NEVER GET HERE!!!

System.out.println("RECEIVED: “+message+” IN CHAT "+chat);

}

});

//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////

What am I missing / what am I doing wrong here?

Please always state the version of Smack you are using.

I’m using the master branch of the git repository,

4.0.0-rc2-SNAPSHOT

The code looks correct. I suggest you attach an debugger in order to find out why the listener is not triggered.

Hi I’ve switched to the maven repo version: 4.0.0-rc2 and I still get the same behaviour.

Also, earlier I thought I was able to catch the “incoming messages” via the packetListener, but that’s wrong, those are the outgoing messages. Something’s off here…

The MessageListener of MultiUserChat.createPrivateChat() is ultimately added to the connections recvListeners. There is no chance that those a triggered by outgoing stanzas.

Again, you could simply found out what’s going on by attaching a debugger.