0

I have created a MembersOnly, Persistant Room. In which I have invited multiple occupants. Now I want to fetch detail of room for the user which was invited by creator.

I tried this code :

XMPP requirement :

<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 code to call the from 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];

This should provide me this kinda result :

<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>

But I am getting this result :

<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>

Can any one help me what I am doing wrong.

THanks in advance.

Nilesh Tripathi
  • 100
  • 1
  • 11
  • Few correction, I didnt even get the detail of Public room. If nonOwner access the detail as I suggested way, he is not able to fetch the detail. Please guide. – Nilesh Tripathi Mar 14 '14 at 06:45
  • Check out first two sections in the answer at: [XMPPFramework - Implement Group Chat (MUC)](http://stackoverflow.com/questions/19268629/xmppframework-implement-group-chat-muc) – Keith OYS Jul 16 '14 at 14:37

1 Answers1

0

If you want to get the room info , you can call the mothod on XMPPRoom

- (void)fetchConfigurationForm;

Then , get the room info in the room's Delegate method

- (void)xmppRoom:(XMPPRoom *)sender didFetchConfigurationForm:(NSXMLElement *)configForm;
Weizhi
  • 174
  • 4
  • 22
  • Hi Dee, Thanks to reply. But I already did it.I tried to fetch roomDetail by fetchConfigurationForm but I got error. (didNotFetchConfigurationForm delegate method called and iq type is error). I think issue is with roles, affiliations, Privileges. Do you have any idea what type of Roles, Affiliations, and Privileges need to assign to invited user by which I will get room detail calling same fetchConfigurationForm method. – Nilesh Tripathi Mar 27 '14 at 09:42
  • please read the doc [!XEP-0045](http://xmpp.org/extensions/xep-0045.html#associations) – Weizhi Apr 29 '14 at 06:50
  • Hey, @NileshTripathi, I think you are getting errors while fetching configuration cause you are not joined to room (this is my current situation) Fetching Details possible without joining the room – KostiaZzz May 26 '21 at 11:08