title: How to get list of rooms joined by a given user in xmpp?
body: <p>I am developing the chat application using xmpp ejabberd. I want to develop an XMPP group chat similar to whats app. XMPP group chat setup is done on my  XMPP server. I am successfully creating the room &amp; joining the room. But I want the rooms in which I have joined. I am using the following iq for fetching the list of groups from server</p>
  
  <pre><code>NSString* server = @"conference.test.com"; 
  XMPPJID *serverJID = [XMPPJID jidWithString:server];
  XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:serverJID];
  [iq addAttributeWithName:@"from" stringValue:[[APP_DELEGATE xmppStream] myJID].full];
  NSXMLElement *query = [NSXMLElement elementWithName:@"query"];
  [query addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/disco#items"];
  [iq addChild:query];
  [[APP_DELEGATE xmppStream] sendElement:iq];
  </code></pre>
  
  <p>from the above code I am getting the list of groups from my server but I want the list of groups which I have joined or the groups from which I got the invitation.</p>
  
  <p>Code for create &amp; join the room is as follows</p>
  
  <pre><code>-(void) CreateRoom:(NSString *)roomJid {
  
  
  static dispatch_once_t queueCreationGuard;
  static dispatch_queue_t queue;
  dispatch_once(&amp;queueCreationGuard, ^{
      queue = dispatch_queue_create("com.something.myapp.backgroundQueue", 0);
  });
  
  XMPPRoomMemoryStorage *roomStorage = [[XMPPRoomMemoryStorage alloc] init];
  XMPPJID *roomJID = [XMPPJID jidWithString:roomJid];
  XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomStorage jid:roomJID dispatchQueue:queue];
  [xmppRoom activate:[self xmppStream]];
  [xmppRoom addDelegate:self
          delegateQueue:queue];
  
  NSXMLElement *history = [NSXMLElement elementWithName:@"history"];
  [history addAttributeWithName:@"maxstanzas" stringValue:@"0"];
  
  [xmppRoom joinRoomUsingNickname:[self xmppStream].myJID.user
                          history:history
                         password:nil];
  }
  
  
  - (void)xmppRoomDidCreate:(XMPPRoom *)sender
   {
      NSLog(@"Room Created");
   }
   - (void)xmppRoomDidJoin:(XMPPRoom *)sender
  {
      NSLog(@"Room Joined");
  }
  </code></pre>
  
  <p>If anyone have solution please answer the question. Thanks</p>