def onPlayerStateChanged(self, functional, roster, pInfo): if pInfo.isOffline(): self._channel.removeMembers([pInfo.dbID]) self._refreshMembersDP() elif not self._channel.hasMember(pInfo.dbID): self._channel.addMembers([BWMemberEntity(pInfo.dbID, pInfo.name)]) self._refreshMembersDP()
def _SetMembersListIterator(members): from messenger.proto.bw_chat2.entities import BWMemberEntity for dbID, nickName in members: yield BWMemberEntity(dbID, nickName)
def __convert(pInfo): return BWMemberEntity(pInfo.dbID, pInfo.name)
def onPlayerAdded(self, functional, pInfo): self._channel.addMembers([BWMemberEntity(pInfo.dbID, pInfo.name)]) self._refreshMembersDP()