docs: def invite_user(self, new_member, inviter=None, roster=None):
          """Invites a new member to the chatroom"""
          roster = roster or self.client.getRoster()
          jid = new_member['JID']
  
          logger.info('roster %s %s' % (jid, roster.getSubscription(jid)))
          if jid in roster.keys() and roster.getSubscription(jid) in ['both', 'to']:
              new_member['STATUS'] = 'ACTIVE'
              if inviter:
                  self.send_message('%s is already a member' % (jid,), inviter)
          else:
              new_member['STATUS'] = 'INVITED'
              self.broadcast('inviting %s to the room' % (jid,))
  
              #Add nickname according to http://xmpp.org/extensions/xep-0172.html
              subscribe_presence = xmpp.dispatcher.Presence(to=jid, typ='subscribe')
              if 'NICK' in self.params:
                  subscribe_presence.addChild(name='nick', namespace=xmpp.protocol.NS_NICK, payload=self.params['NICK'])
              self.client.send(subscribe_presence)
  
          if not self.is_member(new_member):
              new_member.setdefault('NICK', jid.split('@')[0])
              self.params['MEMBERS'].append(new_member)