bans - untested

This commit is contained in:
ingvar1995 2018-08-05 21:05:18 +03:00
parent 37541db07d
commit 741adcdf18
13 changed files with 334 additions and 21 deletions

View file

@ -4,6 +4,7 @@ import utils.util as util
from groups.group_peer import GroupChatPeer
from wrapper import toxcore_enums_and_consts as constants
from common.tox_save import ToxSave
from groups.group_ban import GroupBan
class GroupChat(contact.Contact, ToxSave):
@ -102,6 +103,19 @@ class GroupChat(contact.Contact, ToxSave):
peers = property(get_peers)
def get_bans(self):
ban_ids = self._tox.group_ban_get_list(self._number)
bans = []
for ban_id in ban_ids:
ban = GroupBan(ban_id,
self._tox.group_ban_get_target(self._number, ban_id),
self._tox.group_ban_get_time_set(self._number, ban_id))
bans.append(ban)
return bans
bans = property(get_bans)
# -----------------------------------------------------------------------------------------------------------------
# Private methods
# -----------------------------------------------------------------------------------------------------------------