Exemple #1
0
 def __addMember(self, jid, dbID, nickname, presence, mucInfo):
     _, found = self._searchChannel(jid.getBareJID())
     if found is not None:
         found.addMember(
             entities.XMPPMUCOccupant(jid, nickname, dbID, presence,
                                      mucInfo))
     return
Exemple #2
0
 def setPresence(self, jid, dbID, nickname, presence, mucInfo):
     result = False
     if self._step == ENTRY_STEP.UNDEFINED:
         return result
     else:
         if jid.getBareJID() == self._room.getID():
             result = True
             if presence in PRESENCE.OFFLINE:
                 self._room.removeMember(jid)
                 if jid == self._getUserJID():
                     self._leave(mucInfo)
             else:
                 if not dbID and mucInfo is not None and MUC_STATUS.SELF_PRESENCE in mucInfo.statuses:
                     dbID = utils.getPlayerDatabaseID()
                 self._room.addMember(entities.XMPPMUCOccupant(jid, nickname, dbID, presence, mucInfo))
                 if jid == self._getUserJID():
                     self._join(mucInfo)
         return result