SMACK Api: Does a MultiUserChat created with Anonymous connection support InvitationRejectionListener? July 9
I wasted more than four hours on this bug (feature?). I have an Ajax front end (using GWT) which connects to my existing Jabber Server (Openfire 3.3.0) using anonymous login (over SSL). For connectivity from my middle tire to Jabber server, I use Smack API version 3.0.4. Now, as I tried to implement InvitationRejectionListener on my MultiUserChat object (which was created with anonymous login), I found out the no packet was being forwarded to MUC (MultiUserChat) object from the jabber server. Now if I make that connection with a registered user, it works fine! Here is the troublesome code:
XMPPConnection conn = new XMPPConnection(connectionConfiguration);
conn.connect();
conn.loginAnonymously();
final MultiUserChat muc = new MultiUserChat(conn, "myroom@conference.domain");
muc.create("testmuc");
muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
muc.addInvitationRejectionListener(new InvitationRejectionListener() {
public void invitationDeclined(String invitee, String reason) {
System.out.println("User 1 recives a rejected invitation from user: "
+ invitee + ", room: " + muc.getRoom());
}
});
Thread.sleep(300);
muc.invite("mozammel@domain", "none");
Thread.sleep(10000);
muc.destroy("The room has almost no activity...", null);
Isn’t it possible to implement InvitationRejectionListener on anonymously connected MUC object? Still trying to find out….