fixes after revert. identicons update

This commit is contained in:
ingvar1995 2018-07-05 00:26:05 +03:00
parent e8193afedf
commit d09609a5e5
3 changed files with 7 additions and 3 deletions

View File

@ -299,7 +299,7 @@ class App:
self._app.exec_()
if p.result is not None:
return p.result
raise SystemExit()
self._force_exit()
def _reset(self):
"""
@ -380,6 +380,9 @@ class App:
def _create_tox(self, data):
return tox_factory(data, self._settings)
def _force_exit(self):
raise SystemExit()
def _init_callbacks(self):
callbacks.init_callbacks(self._tox, self._profile, self._settings, self._plugin_loader, self._contacts_manager,
self._calls_manager, self._file_transfer_handler, self._ms, self._tray,

View File

@ -1,4 +1,5 @@
from pydenticon import Generator
import hashlib
class BaseTypingNotificationHandler:
@ -34,6 +35,7 @@ def generate_avatar(public_key):
'rgb(49,203,115)',
'rgb(141,69,170)']
generator = Generator(5, 5, foreground=foreground, background='rgba(42,42,42,0)')
identicon = generator.generate(public_key, 220, 220, padding=(10, 10, 10, 10))
digest = hashlib.sha256(public_key.encode('utf-8')).hexdigest()
identicon = generator.generate(digest, 220, 220, padding=(10, 10, 10, 10))
return identicon

View File

@ -347,5 +347,4 @@ class ReceiveAvatar(ReceiveTransfer):
chdir(dirname(avatar_path))
remove(avatar_path)
rename(self._path, avatar_path)
self._finished()
super().write_chunk(position, data)