fix bug reported by @adbenitez

This commit is contained in:
holger krekel
2020-07-20 15:08:00 +02:00
parent 60b3550952
commit 2cbf2d8f65
3 changed files with 8 additions and 2 deletions

View File

@@ -1,9 +1,11 @@
1.40.x 1.40.1
--------------- ---------------
- emit "ac_member_removed" event (with 'actor' being the removed contact) - emit "ac_member_removed" event (with 'actor' being the removed contact)
for when a user leaves a group. for when a user leaves a group.
- fix create_contact(addr) when addr is the self-contact.
1.40.0 1.40.0
--------------- ---------------

View File

@@ -246,7 +246,6 @@ class Account(object):
addr = as_dc_charpointer(addr) addr = as_dc_charpointer(addr)
name = as_dc_charpointer(name) name = as_dc_charpointer(name)
contact_id = lib.dc_create_contact(self._dc_context, name, addr) contact_id = lib.dc_create_contact(self._dc_context, name, addr)
assert contact_id > const.DC_CHAT_ID_LAST_SPECIAL, contact_id
return Contact(self, contact_id) return Contact(self, contact_id)
def delete_contact(self, contact): def delete_contact(self, contact):

View File

@@ -129,6 +129,11 @@ class TestOfflineContact:
assert not contact1.is_blocked() assert not contact1.is_blocked()
assert not contact1.is_verified() assert not contact1.is_verified()
def test_create_self_contact(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
contact1 = ac1.create_contact(ac1.get_config("addr"))
assert contact1.id == 1
def test_get_contacts_and_delete(self, acfactory): def test_get_contacts_and_delete(self, acfactory):
ac1 = acfactory.get_configured_offline_account() ac1 = acfactory.get_configured_offline_account()
contact1 = ac1.create_contact("some1@example.org", name="some1") contact1 = ac1.create_contact("some1@example.org", name="some1")