comparison src/server/blog.py @ 749:7168a9873dde

server_side (blog): fixes avatar callback
author souliane <souliane@mailoo.org>
date Mon, 23 Nov 2015 22:02:18 +0100
parents efbd28b3438e
children 78caef6ed8e7
comparison
equal deleted inserted replaced
748:0d5889b9313c 749:7168a9873dde
92 return 92 return
93 log.debug(_(u"Received a new avatar for entity %s") % entity_s) 93 log.debug(_(u"Received a new avatar for entity %s") % entity_s)
94 94
95 url = os.path.join(C.AVATARS_DIR, value) 95 url = os.path.join(C.AVATARS_DIR, value)
96 self.avatars_cache[entity_s] = url 96 self.avatars_cache[entity_s] = url
97 self.waiting_deferreds[entity_s].callback(url) 97 try:
98 del self.waiting_deferreds[entity_s] 98 self.waiting_deferreds[entity_s].callback(url)
99 del self.waiting_deferreds[entity_s]
100 except KeyError:
101 pass
99 102
100 def getAvatarURL(self, pub_jid): 103 def getAvatarURL(self, pub_jid):
101 """Return avatar of a jid if in cache, else ask for it. 104 """Return avatar of a jid if in cache, else ask for it.
102 105
103 @param pub_jid (JID): publisher JID 106 @param pub_jid (JID): publisher JID