title: didReceiveInvitation() is not being called in XMPPFramework and Swift 2
body: <p>I am creating chatting application like <strong>Whatsapp</strong>.<br>
  I have successfully write the functionality of Text chat, Image, Audio, Video Transfer. Now I am creating the Multi user chat. After a long R&amp;D I am asking this question. Please tell me what I am doing wrong in my code. I have followed all these tutorials but not luck</p>
  
  <p><a href="https://github.com/robbiehanson/XMPPFramework/issues/640" rel="nofollow noreferrer">https://github.com/robbiehanson/XMPPFramework/issues/640</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10371550/muc-how-to-with-xmppframework">MUC How-to with XMPPFramework</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14665654/accepting-chatroom-invitation">Accepting chatroom invitation</a></p>
  
  <p><strong>Ok Below is my Code</strong></p>
  
  <h2><strong>1. After setting the STREAM successfully i set the XMPPMUC delegate for Invitation in goOnline Method</strong></h2>
  
  <pre><code>private func goOnline() {
      let presence = XMPPPresence()
      let domain = xmppStream.myJID.domain
  
      if domain == "gmail.com" || domain == "gtalk.com" || domain == "talk.google.com"
          //        || domain == "chat.alqatech.com"
      {
          let priority = DDXMLElement.elementWithName("priority", stringValue: "24") as! DDXMLElement
          presence.addChild(priority)
      }
      xmppMUC = XMPPMUC(dispatchQueue: dispatch_get_main_queue())
      xmppMUC!.activate(self.xmppStream)
      xmppMUC!.addDelegate(self, delegateQueue: dispatch_get_main_queue())
  
      xmppStream.sendElement(presence)
  }
  </code></pre>
  
  <h2>2. Create a group</h2>
  
  <pre><code>func createGroupChat(members:[String],groupName:String){
          membersToInvite = members
          xmppRoomMemoryStorage = XMPPRoomMemoryStorage()
          let xmppJid = XMPPJID.jidWithString("\(groupName)@conference.chat.xxxxxx.com")
          let xmppRoom = XMPPRoom.init(roomStorage: xmppRoomMemoryStorage, jid: xmppJid)
          xmppRoom.activate(xmppStream)
          xmppRoom.addDelegate(self, delegateQueue: dispatch_get_main_queue())
          xmppRoom.joinRoomUsingNickname(xmppStream.myJID.user, history: nil)
      }
  </code></pre>
  
  <h2>3. Group Created Successfully</h2>
  
  <pre><code>func xmppRoomDidCreate(sender: XMPPRoom!) {
          print(sender)
      }
  </code></pre>
  
  <h2>4. xmppRoomDidJoin called successfully then here i invite users</h2>
  
  <pre><code>func xmppRoomDidJoin(sender: XMPPRoom!) {
          sender.fetchConfigurationForm()
          for JID in membersToInvite! {
              sender.editRoomPrivileges([XMPPRoom.itemWithAffiliation("member", jid: XMPPJID.jidWithString(JID))])
              sender.inviteUser(XMPPJID.jidWithString(JID), withMessage: "THIS IS GROUP MESSAGE")
  
          }
  
      }
  </code></pre>
  
  <h2>5. didFetchConfigurationForm called successfully</h2>
  
  <pre><code>func xmppRoom(sender: XMPPRoom!, didFetchConfigurationForm configForm: DDXMLElement!) 
  {
  
          let newConfig: DDXMLElement = configForm.copy() as! DDXMLElement
          let fields: [AnyObject] = newConfig.elementsForName("field")
          for field in fields {
              let vars: String = field.attributeStringValueForName("var")
              // Make Room Persistent
              if (vars == "muc#roomconfig_persistentroom") {
                  field.removeChildAtIndex(0)
                  field.addChild(DDXMLElement(name: "value", stringValue : "1"))
              }
          }
          sender.configureRoomUsingOptions(newConfig)
  
  
      }
  </code></pre>
  
  <h2>6. didReceiveInvitation it is not being called.</h2>
  
  <pre><code>func xmppMUC(sender: XMPPMUC!, roomJID: XMPPJID!, didReceiveInvitation message: XMPPMessage!) {
          print(roomJID)
          xmppRoomMemoryStorage = XMPPRoomMemoryStorage()
          let xmppRoom = XMPPRoom.init(roomStorage: xmppRoomMemoryStorage, jid: roomJID)
          xmppRoom.activate(xmppStream)
          xmppRoom.addDelegate(self, delegateQueue: dispatch_get_main_queue())
          xmppRoom.joinRoomUsingNickname(xmppStream.myJID.user, history: nil)
  
      }
  </code></pre>