Mercurial > libervia-web
comparison src/browser/libervia_main.py @ 479:c21ea1fe3593
browser side: small refactoring to prepare displaying avatars in the contact panel
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 14 Jun 2014 19:10:51 +0200 |
parents | 992b900ab876 |
children | 50b286866739 |
comparison
equal
deleted
inserted
replaced
478:992b900ab876 | 479:c21ea1fe3593 |
---|---|
247 #needed to prevent request cancellation in Firefox | 247 #needed to prevent request cancellation in Firefox |
248 event.preventDefault() | 248 event.preventDefault() |
249 return True | 249 return True |
250 | 250 |
251 def getAvatar(self, jid_str): | 251 def getAvatar(self, jid_str): |
252 """Return avatar of a jid if in cache, else ask for it""" | 252 """Return avatar of a jid if in cache, else ask for it. |
253 | |
254 @param jid_str (str): JID of the contact | |
255 @return: the URL to the avatar (str) | |
256 """ | |
253 def dataReceived(result): | 257 def dataReceived(result): |
254 if 'avatar' in result: | 258 if 'avatar' in result: |
255 self._entityDataUpdatedCb(jid_str, 'avatar', result['avatar']) | 259 self._entityDataUpdatedCb(jid_str, 'avatar', result['avatar']) |
256 else: | 260 else: |
257 self.bridge.call("getCard", None, jid_str) | 261 self.bridge.call("getCard", None, jid_str) |