Reputation: 256
Multi User Chat Room Join
How to join a multi user chat room as "owner" in android?. Currently I am joining the multi user chat room using the following code. However I am joining as a participant only.
MultiUserChat muc = new MultiUserChat(connection, group);
muc.join(nickNameOfUser, password);
Upvotes: 0
Views: 1956
Reputation: 5793
// In Smack version 4.1.4 i am able to join Room by following way.
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
manager.addInvitationListener(new InvitationListener() {
@Override
public void invitationReceived(XMPPConnection conn, MultiUserChat room, String inviter, String reason, String password, Message message) {
try {
room.join(userName);
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
} catch (XMPPException.XMPPErrorException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
}
});
Upvotes: 1
Reputation: 5266
MUC members/owners list maintained on the MUC server side, and automatically grant you owner privileges on create/join room. If you not receive owner privileges, then room was created by someone else.
Upvotes: 2