I have the following code to listen for invitations to a chatroom:
Connection.DEBUG_ENABLED = true;
XMPPConnection connection = new XMPPConnection("jabber.org");
connection.connect();
connection.login("username", "password");
MultiUserChat.addInvitationListener(connection, new InvitationListener() {
@Override
public void invitationReceived(Connection arg0, String arg1,
String arg2, String arg3, String arg4, Message arg5) {
System.out.println("Invitation Received!");
}
});
System.out.println("Connected, waiting for invitation");
while(true) {
Thread.yield();
}
}
I then use another account to login with pidgin create a chatroom, and invite the above user. The invitationReceived method is not called. The smack debugger receives a presence update when I login, but no other packets. However, if I am logged in to the above user with pidgin, I do receive the invitation. How can I make smack detect the invitation request?