【发布时间】:2014-03-07 14:05:32
【问题描述】:
我创建了一个仅限会员的永久房间。我邀请了多名住户。 现在我想为创建者邀请的用户获取房间的详细信息。
我试过这段代码:
XMPP 要求:
<iq from='hag66@shakespeare.lit/pda'
id='ik3vs715'
to='coven@chat.shakespeare.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
从 iOS 调用的 iOS 代码
NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"http://jabber.org/protocol/disco#info"];//
NSString *iqID = [[appDelegate xmppStream] generateUUID];
XMPPJID *jID = self.room.roomJID;
XMPPIQ *element = [XMPPIQ iqWithType:@"get" to:jID elementID:iqID child:query];
[element addAttributeWithName:@"from" stringValue:[[[appDelegate xmppStream] myJID] full]];
[[appDelegate xmppStream] fetchInformationForGivenIQ:element];
这应该给我这样的结果:
<iq from='coven@chat.shakespeare.lit'
id='ik3vs715'
to='hag66@shakespeare.lit/pda'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity
category='conference'
name='A Dark Cave'
type='text'/>
<feature var='http://jabber.org/protocol/muc'/>
<feature var='muc_passwordprotected'/>
<feature var='muc_hidden'/>
<feature var='muc_temporary'/>
<feature var='muc_open'/>
<feature var='muc_unmoderated'/>
<feature var='muc_nonanonymous'/>
</query>
</iq>
但我得到了这个结果:
<iq xmlns="jabber:client" type="result" id="some ID" from="Group-ID" to="My Full JabberID">
<query xmlns="http://jabber.org/protocol/disco#info">
<feature var="http://jabber.org/protocol/disco#info">
</feature>
</query>
</iq>
谁能帮我解决我做错了什么。
提前致谢。
【问题讨论】:
-
少量更正,我什至没有得到公共房间的细节。如果 nonOwner 按照我建议的方式访问详细信息,他将无法获取详细信息。请指导。
-
查看答案中的前两个部分:XMPPFramework - Implement Group Chat (MUC)
标签: ios objective-c xmpp xmppframework