Destroy an xmppRoom #323

grisleyb opened this Issue Mar 6, 2014 · 2 comments


None yet
3 participants

grisleyb commented Mar 6, 2014

Whenever I or someone enter the chat room I get their presence like this:

presence xmlns="jabber:client" to="" from="">

x xmlns="">
item jid="" affiliation="owner" role="moderator"/>

On the basis of this I can check whether the user is an owner or not. In case of owner, I can provide a destory/delete room button.

Is there an y other way to get list of owners for a chat room?

Hi grisleyb,
Please read more here a, I think that you just implement extension 0045 to do this. XMPP Framework's xep 0045 provide all methods and delegates for controll MUC's member, configuration, permission, role, presence....etc.
Let's use it for leave / destroy room.

jonasman commented Mar 7, 2014

there is a way but not fully in the XMPPFramework, you need to ask for the affiliations xmppframework ou can fetch only members: - (void)fetchMembersList
if you need also owners :

  • (void)fetchOwnersList
    dispatch_block_t block = ^{ @autoreleasepool {

    // <iq type='get'
    //       id='mod3'
    //       to='coven@chat.shakespeare.lit'>
    //   <query xmlns=''>
    //     <item affiliation='owner'/>
    //   </query>
    // </iq>
    NSString *fetchID = [xmppStream generateUUID];
    NSXMLElement *item = [NSXMLElement elementWithName:@"item"];
    [item addAttributeWithName:@"affiliation" stringValue:@"owner"];
    NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace];
    [query addChild:item];
    XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query];
    [xmppStream sendElement:iq];
    [responseTracker addID:fetchID


    if (dispatch_get_specific(moduleQueueTag))
    dispatch_async(moduleQueue, block);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment