ui checkbox update and friend addition via public key

This commit is contained in:
ingvar1995 2016-05-08 23:13:06 +03:00
parent 160e9dc72f
commit 0e103749a2
5 changed files with 14 additions and 11 deletions

View file

@ -802,6 +802,9 @@ class Profile(Contact, Singleton):
tox_id = tox_dns(tox_id) tox_id = tox_dns(tox_id)
if tox_id is None: if tox_id is None:
raise Exception('TOX DNS lookup failed') raise Exception('TOX DNS lookup failed')
if len(tox_id) == TOX_PUBLIC_KEY_SIZE * 2: # public key
self.add_friend(tox_id)
else:
result = self._tox.friend_add(tox_id, message.encode('utf-8')) result = self._tox.friend_add(tox_id, message.encode('utf-8'))
tox_id = tox_id[:TOX_PUBLIC_KEY_SIZE * 2] tox_id = tox_id[:TOX_PUBLIC_KEY_SIZE * 2]
item = self.create_friend_item() item = self.create_friend_item()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

File diff suppressed because one or more lines are too long