From 0c54f8bd7612379a5d3bf31804a4245eef2da99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asiel=20D=C3=ADaz=20Ben=C3=ADtez?= Date: Fri, 17 May 2019 14:38:59 -0400 Subject: [PATCH] Update chatting.py (#678) added `remove_contact` method --- python/src/deltachat/chatting.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/src/deltachat/chatting.py b/python/src/deltachat/chatting.py index bc9ac220..350a09fd 100644 --- a/python/src/deltachat/chatting.py +++ b/python/src/deltachat/chatting.py @@ -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.