Question

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);
Was it helpful?

Solution

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.

OTHER TIPS

// 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();
                        }
                    }
                });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top