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;
this._netlogConf = NetlogConf.getInstance();
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));
catch (XMPPException ex)
// do nothing… just let them invite the bot again
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!