contact context menu fixes

This commit is contained in:
ingvar1995 2018-05-11 00:35:56 +03:00
parent 25dbb85ef0
commit 7898363dcb
3 changed files with 23 additions and 12 deletions

View file

@ -30,7 +30,7 @@ class ContactsManager:
def __del__(self):
del self._history
def get_friend(self, num):
def get_contact(self, num):
if num < 0 or num >= len(self._contacts):
return None
return self._contacts[num]
@ -359,6 +359,13 @@ class ContactsManager:
self.add_friend(tox_id)
self.save_profile()
# -----------------------------------------------------------------------------------------------------------------
# Groups support
# -----------------------------------------------------------------------------------------------------------------
def get_group_chats(self):
return list(filter(lambda c: type(c) is not Friend, self._contacts)) # TODO: fix after gc implementation
# -----------------------------------------------------------------------------------------------------------------
# Friend requests
# -----------------------------------------------------------------------------------------------------------------