comparison src/server/blog.py @ 679:a90cc8fc9605

merged branch frontends_multi_profiles
author Goffi <goffi@goffi.org>
date Wed, 18 Mar 2015 16:15:18 +0100
parents c8cca1a373dd 7af8f4ab3675
children 9877607c719a
comparison
equal deleted inserted replaced
590:1bffc4c244c3 679:a90cc8fc9605
94 try: 94 try:
95 entity_jid_s = [key for (key, value) in self.waiting_deferreds.items() if value[0] == action_id][0] 95 entity_jid_s = [key for (key, value) in self.waiting_deferreds.items() if value[0] == action_id][0]
96 except IndexError: # impossible to guess the entity 96 except IndexError: # impossible to guess the entity
97 return 97 return
98 log.debug(_("Using default avatar for entity %s") % entity_jid_s) 98 log.debug(_("Using default avatar for entity %s") % entity_jid_s)
99 self.avatars_cache[entity_jid_s] = C.DEFAULT_AVATAR 99 self.avatars_cache[entity_jid_s] = C.DEFAULT_AVATAR_URL
100 self.waiting_deferreds[entity_jid_s][1].callback(C.DEFAULT_AVATAR) 100 self.waiting_deferreds[entity_jid_s][1].callback(C.DEFAULT_AVATAR_URL)
101 del self.waiting_deferreds[entity_jid_s] 101 del self.waiting_deferreds[entity_jid_s]
102 102
103 def getAvatar(self, profile): 103 def getAvatar(self, profile):
104 """Get the avatar of the given profile 104 """Get the avatar of the given profile
105 105
106 @param profile (str): 106 @param profile(unicode): %(doc_profile)s
107 @return: deferred avatar path, relative to the server's root 107 @return: deferred avatar path, relative to the server's root
108 """ 108 """
109 jid_s = (profile + '@' + self.host.bridge.getNewAccountDomain()).lower() 109 jid_s = (profile + '@' + self.host.bridge.getNewAccountDomain()).lower()
110 if jid_s in self.avatars_cache: 110 if jid_s in self.avatars_cache:
111 return defer.succeed(self.avatars_cache[jid_s]) 111 return defer.succeed(self.avatars_cache[jid_s])