退出的组仍显示在组列表 xmpp 中


XMPPJID *servrJID = [XMPPJID jidWithString:@"conference.localhost"];
XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:servrJID];
[iq addAttributeWithName:@"from" stringValue:[[self xmppStream] myJID].full];
NSXMLElement *query = [NSXMLElement elementWithName:@"query"];
[query addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/disco#items"];
[iq addChild:query];
[[self xmppStream] sendElement:iq];

该组在杀死应用程序后保持原样,组自动重新加入,

仍然得到我离开/停用的组名称

 XMPPJID *roomJID = [XMPPJID jidWithString:Roomjdi];
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPRoom *xmppRooms = [[XMPPRoom alloc]
                       initWithRoomStorage:roomMemoryStorage
                       jid:roomJID
                       dispatchQueue:dispatch_get_main_queue()];
[xmppRooms removeDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRooms deactivate];
[xmppRooms leaveRoom];

你知道为什么我在这里再次获得组名吗?

如果先停用聊天室,则会断开聊天室与直播的连接。因此,您不能留出空间。因此,如果您想离开房间,请先调用离开房间功能,然后停用房间。

例:

XMPPJID *roomJID = [XMPPJID jidWithString:Roomjdi];
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPRoom *xmppRooms = [[XMPPRoom alloc]
                       initWithRoomStorage:roomMemoryStorage
                       jid:roomJID
                       dispatchQueue:dispatch_get_main_queue()];
[xmppRooms removeDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRooms leaveRoom];
[xmppRooms deactivate];

最新更新