introduce Account.get_blocked_contacts

also introduce Contact.block() and Contact.unblock() methods
and deprecate the c-ish "Contact.set_blocked()" api.
fixes #2011
This commit is contained in:
holger krekel
2020-10-20 11:23:05 +02:00
parent df56b76182
commit 5a9a4dbbab
3 changed files with 34 additions and 1 deletions

View File

@@ -263,6 +263,17 @@ class Account(object):
"""
return Contact(self, contact_id)
def get_blocked_contacts(self):
""" return a list of all blocked contacts.
:returns: list of :class:`deltachat.contact.Contact` objects.
"""
dc_array = ffi.gc(
lib.dc_get_blocked_contacts(self._dc_context),
lib.dc_array_unref
)
return list(iter_array(dc_array, lambda x: Contact(self, x)))
def get_contacts(self, query=None, with_self=False, only_verified=False):
""" get a (filtered) list of contacts.