MultiUserChat.addInvitationListener not working anymore?

Hi

I’m working on a chat bot which provides Netlog information to online chatters. The bot works without any problems en does everything we want it to do. The next step is to implement the possibility to invite the bot in a multi user chat so people can use it to ask information or configure the chatroom.

When the bot is connected and logged in to the server, I call a method _initMUC() which contains the following piece of code:

private void _initMUC()
{
MultiUserChat.addInvitationListener(_conn, new NetlogMUCInvitationHandler());

NetlogDebugger.log(“Netlog Jabber bot started the multi user chat listener”);
}

The class NetlogMUCInvitationHandler looks like this:

public class NetlogMUCInvitationHandler implements InvitationListener
{
private NetlogConf _netlogConf;

public NetlogMUCInvitationHandler()
{
this._netlogConf = NetlogConf.getInstance();
}

@Override
public void invitationReceived(XMPPConnection conn, String room, String inviter, String reason, String password, Message message)
{
NetlogDebugger.log("Netlog Jabber bot: received a group chat invitation from " + inviter + " in the room " + room + " with reason " + reason + " and message " + message);

    MultiUserChat m = new MultiUserChat(conn, room);
    m.addMessageListener(new NetlogMUCMessageListener(m));

try
{
m.join(_netlogConf.getJabberBotNickname(), password);
}
catch (XMPPException ex)
{
// do nothing… just let them invite the bot again :wink:
}
}
}

The NetlogMUCMessageListener class just responds with the same message as to the incoming message.

The problem here is, the MultiUserChat.addInvitationListener doesn’t do the trick… it actually does nothing at all… when I enable the Smack debugging console, in the RAW received packets tab, I can see the chat invitation received from a chatter (I tested it with 4 clients) but when I look at the first tab with the packets overview, there is no sign of a invitation packet.

Did I forget something or is this a bug? I’m Using smack 3.1.0.

Thanks in advance!

Cliff Ophalvens

Had someone else also this problem?

Thanks in advance!

Cliff

Somebody?

I check my code with yours, and its the same.

Only that i don’t see the need of @Override since your don’t extend a InvitationListener but implement it. (witch is correct)

Maybe thats your problem?

Are you sure the connection _conn is not null and connected at this point?

That could be the solution, but when I remove the @Overide, Netbeans adds a notification which says @Overide is needed.

I’m also shure the conn object is not null and we are connected and logged in.

I’ll try to remove the @Overide as soon as possible but first I need to finish some other work.

Thanks for your help!

Cliff