api!(python): use dc_contact_get_verifier_id()

get_verifier() returns a Contact rather than an address now

dc_contact_get_verifier_addr() is unused.
This commit is contained in:
link2xt
2023-09-29 13:37:29 +00:00
parent 6d2ac30461
commit ef4d2a7ed0
2 changed files with 9 additions and 6 deletions

View File

@@ -75,9 +75,12 @@ class Contact:
"""Return True if the contact is verified."""
return lib.dc_contact_is_verified(self._dc_contact) == 2
def get_verifier(self, contact):
def get_verifier(self, contact) -> Optional["Contact"]:
"""Return the address of the contact that verified the contact."""
return from_dc_charpointer(lib.dc_contact_get_verifier_addr(contact._dc_contact))
verifier_id = lib.dc_contact_get_verifier_id(contact._dc_contact)
if verifier_id == 0:
return None
return Contact(self.account, verifier_id)
def get_profile_image(self) -> Optional[str]:
"""Get contact profile image.