diff options
author | mathieui <mathieui@mathieui.net> | 2018-02-11 19:53:38 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-02-11 19:53:38 +0100 |
commit | 87ed4aff12e6251ced6a34e50fe643b84e60790f (patch) | |
tree | eb97f7d55d9240ae59bc1ee3dfc927b71932c675 /poezio/core/handlers.py | |
parent | 957ee8084d89d5437d047aa3fef734fe005497c4 (diff) | |
download | poezio-87ed4aff12e6251ced6a34e50fe643b84e60790f.tar.gz poezio-87ed4aff12e6251ced6a34e50fe643b84e60790f.tar.bz2 poezio-87ed4aff12e6251ced6a34e50fe643b84e60790f.tar.xz poezio-87ed4aff12e6251ced6a34e50fe643b84e60790f.zip |
Fix the nick conflict code
also yapf -rip
Diffstat (limited to 'poezio/core/handlers.py')
-rw-r--r-- | poezio/core/handlers.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index 626f2093..60cf405d 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -415,7 +415,8 @@ class HandlerCore: result = yield from self.core.xmpp[ 'xep_0084'].retrieve_avatar( jid, avatar_hash, timeout=60) - avatar = result['pubsub']['items']['item']['avatar_data']['value'] + avatar = result['pubsub']['items']['item']['avatar_data'][ + 'value'] if sha1(avatar).hexdigest().lower() != avatar_hash.lower(): raise Exception('Avatar sha1 doesn’t match 0084 hash.') contact.avatar = avatar @@ -433,7 +434,10 @@ class HandlerCore: with open(cached_path, 'wb') as avatar_file: avatar_file.write(contact.avatar) except OSError: - log.debug('Failed writing %s avatar to cache:', jid, exc_info=True) + log.debug( + 'Failed writing %s avatar to cache:', + jid, + exc_info=True) pass return |