address @hocuri comment -- remove as_contact() as it's synonym with create_contact

and the latter is already an established API and conveys better that a contact
object will be created if it doesn't exist.
This commit is contained in:
holger krekel
2020-06-09 13:14:22 +02:00
parent 0bb4ef0bd9
commit 0c8f951d8f
4 changed files with 19 additions and 22 deletions

View File

@@ -337,7 +337,7 @@ class Chat(object):
:raises ValueError: if contact could not be added
:returns: None
"""
contact = self.account.as_contact(obj)
contact = self.account.create_contact(obj)
ret = lib.dc_add_contact_to_chat(self.account._dc_context, self.id, contact.id)
if ret != 1:
raise ValueError("could not add contact {!r} to chat".format(contact))
@@ -350,7 +350,7 @@ class Chat(object):
:raises ValueError: if contact could not be removed
:returns: None
"""
contact = self.account.as_contact(obj)
contact = self.account.create_contact(obj)
ret = lib.dc_remove_contact_from_chat(self.account._dc_context, self.id, contact.id)
if ret != 1:
raise ValueError("could not remove contact {!r} from chat".format(contact))