def restore(self, jid, state): result = False if not g_settings.server.XMPP.isMucServiceAllowed(): return result else: created, exists = self._searchChannel(jid_entity.JID(jid)) if exists is None: result = created.setPersistentState(state) if result: isConnected = self.client().isConnected() if self._addChannel(created, isJoined=isConnected) and isConnected: self.joinToRoom(created.getID(), created.getPassword(), initResult=ACTION_RESULT.DO_NOTHING) return result
def _getUserJID(self): jid = jid_entity.JID(self._room.getID()) jid.setResource(utils.getPlayerName()) return jid