summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-10-07 18:53:05 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-10-07 18:53:05 +0100
commit62344cb725c1779892eadce0402f747b798272ba (patch)
tree3b3a8f3c2ab858d7f5bf41e4676b94e49611eae9
parent554ff650bff79488d259f32622dbc6b49842c243 (diff)
downloadpoezio-62344cb725c1779892eadce0402f747b798272ba.tar.gz
poezio-62344cb725c1779892eadce0402f747b798272ba.tar.bz2
poezio-62344cb725c1779892eadce0402f747b798272ba.tar.xz
poezio-62344cb725c1779892eadce0402f747b798272ba.zip
Fix vCard avatars, and increase retrieve timeout to one minute.
-rw-r--r--poezio/core/handlers.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index d8983041..c376b67f 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -371,7 +371,7 @@ class HandlerCore:
try:
result = yield from self.core.xmpp['xep_0084'].retrieve_avatar(jid,
info['id'],
- timeout=10)
+ timeout=60)
contact.avatar = result['pubsub']['items']['item']['avatar_data']['value']
except Exception:
log.exception('Failed retrieving 0084 data from %s:', jid)
@@ -381,12 +381,16 @@ class HandlerCore:
@asyncio.coroutine
def on_vcard_avatar(self, pres):
jid = pres['from'].bare
+ contact = roster[jid]
+ if not contact:
+ return
log.debug('Received vCard avatar update from %s', jid)
try:
result = yield from self.core.xmpp['xep_0054'].get_vcard(jid,
cached=True,
- timeout=10)
- contact.avatar = result['vcard_temp']['PHOTO']
+ timeout=60)
+ avatar = result['vcard_temp']['PHOTO']
+ contact.avatar = avatar['BINVAL']
except Exception:
log.exception('Failed retrieving vCard from %s:', jid)
return