聊天室成员列表 [英] List of chat room members

查看:85
本文介绍了聊天室成员列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用XMPP framework检索聊天室成员列表?

How can I retrieve the list of members of a chat room in using XMPP framework?

我尝试使用:

 - (void)xmppRoom:(XMPPRoom *)sender didFetchMembersList:(NSArray *)items 

但是它返回一个空数组

推荐答案

这个问题很旧,但是我最近遇到了这个确切的问题(xmppRoom:didFetchMembersList:传递了一个空数组).在我的案例中,问题是当用户被邀请到会议室时,他们将扮演参与者"角色,并且隶属关系无". XMPPRoom中的fetchMembersList方法查找具有成员"隶属关系的项目.

This question is old but I recently encountered this exact issue (xmppRoom:didFetchMembersList: is passed an empty array). In my case the problem was that when users got invited to the room they would have a role of "participant" and an affiliation of "none". The fetchMembersList method in XMPPRoom looks for items with an affiliation of "member".

您可以这样更改从属关系:

You can change the affiliation like so:

[xmppRoom editRoomPrivileges:@[[XMPPRoom itemWithAffiliation:@"member" jid:userJID]]];

有关角色和从属关系的详细信息,请参见 XEP-0045 .

For details on roles and affiliations, see XEP-0045.

这篇关于聊天室成员列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆