提到这一点,我正在实现一个组聊天配置。
XMPPFramework - Implement Group Chat (MUC)
然而,作为参与者而不是版主,我无法获得成员名单。我试着读取多个堆栈答案,请求实现'muc#roomconfig_getmemberlist‘,但是XMPPRoom的获取配置委托在回调中没有给出这个字段值。
有谁能告诉我,实现这一点的确切方法是什么,以及如何获取成员列表。
发布于 2016-01-28 07:39:24
默认情况下,这是在服务器中启用的配置,所以只需要设置,我们就必须自定义服务器,以使成员甚至离线和留出空间。因此,为了达到这个要求,像其他聊天应用程序成员一样要显示。
发布于 2016-01-27 11:18:20
创建xmpp房间
/**
This fuction is used to setup room with roomId
*/
-(void)setUpRoom:(NSString *)ChatRoomJID
{
if (!ChatRoomJID)
{
return;
}
// Configure xmppRoom
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPJID *roomJID = [XMPPJID jidWithString:ChatRoomJID];
xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomMemoryStorage jid:roomJID dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:xmppStream];
[xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
NSXMLElement *history = [NSXMLElement elementWithName:@"history"];
[history addAttributeWithName:@" maxchars" stringValue:@"0"];
[xmppRoom joinRoomUsingNickname:xmppStream.myJID.user
history:history
password:nil];
[self performSelector:@selector(ConfigureNewRoom:) withObject:nil afterDelay:4];
}
/**
This fuction is used configure new
*/
- (void)ConfigureNewRoom:(id)sender
{
[xmppRoom configureRoomUsingOptions:nil];
[xmppRoom fetchConfigurationForm];
[xmppRoom fetchBanList];
[xmppRoom fetchMembersList];
[xmppRoom fetchModeratorsList];
}创建房间后使用Xmpp房间的代理方法
- (void)xmppRoom:(XMPPRoom *)sender occupantDidJoin:(XMPPJID *)occupantJID withPresence:(XMPPPresence *)presence
- (void)xmppRoom:(XMPPRoom *)sender occupantDidLeave:(XMPPJID *)occupantJID withPresence:(XMPPPresence *)presence使用这两种委托方法,您可以轻松地维护加入到MUC会议室的用户列表
https://stackoverflow.com/questions/33545612
复制相似问题