如何在xmpp中获得会议成员?

时间:2014-07-18 10:08:20

标签: android xmpp chat

我从github yaxim link下载了yaxim源代码现在我想获得该成员 会议,我试过下面的代码,但它不起作用,

String room  = "test@conference.abc";
Connection xmppConnection;
        ConnectionThread connectionThread = AccountManager.getInstance()
                .getAccount(account).getConnectionThread();
        if (connectionThread == null) {
            Application.getInstance().onError(R.string.NOT_CONNECTED);
            return true;
        }
        xmppConnection = connectionThread.getXMPPConnection();
MultiUserChat userChat = new MultiUserChat(xmppConnection, room);
Iterator<String> roomUsers  = userChat.getOccupants();
        System.out.println("roomUsers count === "+userChat.getOccupantsCount());
        while (roomUsers.hasNext()) {
            String roomOccupants = (String) roomUsers.next();
            System.out.println("room users ==== "+roomOccupants);
        }

但是roomUsers计数返回0。

如果有人知道从会议室获取用户列表的其他方式,那么请告诉我

1 个答案:

答案 0 :(得分:0)

您需要加入 MUC才能看到其成员。