1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-03 17:59:19 +02:00

Update chatting.py (#678)

added `remove_contact` method
This commit is contained in:
Asiel Díaz Benítez 2019-05-17 14:38:59 -04:00 committed by Lars-Magnus Skog
parent fa150b4d6f
commit 0c54f8bd76

View file

@ -231,6 +231,17 @@ class Chat(object):
if ret != 1:
raise ValueError("could not add contact {!r} to chat".format(contact))
def remove_contact(self, contact):
""" remove a contact from this chat.
:params: contact object.
:exception: ValueError if contact could not be removed
:returns: None
"""
ret = lib.dc_remove_contact_from_chat(self._dc_context, self.id, contact.id)
if ret != 1:
raise ValueError("could not remove contact {!r} from chat".format(contact))
def get_contacts(self):
""" get all contacts for this chat.