private messages support
This commit is contained in:
parent
e15620c3ad
commit
5521b768bc
16 changed files with 384 additions and 65 deletions
|
|
@ -11,8 +11,6 @@ class GroupChat(contact.Contact, ToxSave):
|
|||
def __init__(self, tox, profile_manager, message_getter, number, name, status_message, widget, tox_id):
|
||||
super().__init__(profile_manager, message_getter, number, name, status_message, widget, tox_id)
|
||||
ToxSave.__init__(self, tox)
|
||||
status = self._tox.group_is_connected(number)
|
||||
self.set_status(constants.TOX_USER_STATUS['NONE'] if status else None)
|
||||
self._peers = []
|
||||
self._add_self_to_gc()
|
||||
|
||||
|
|
@ -57,6 +55,11 @@ class GroupChat(contact.Contact, ToxSave):
|
|||
|
||||
return peers[0]
|
||||
|
||||
def get_peer_by_public_key(self, public_key):
|
||||
peers = list(filter(lambda p: p.public_key == public_key, self._peers))
|
||||
|
||||
return peers[0]
|
||||
|
||||
def remove_all_peers_except_self(self):
|
||||
self._peers = self._peers[:1]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue