Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0054.py @ 281:1e3e169955b2
typo
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 03 Feb 2011 01:27:09 +0100 |
parents | b1794cbb88e5 |
children | 7c79d4a8c9e6 |
comparison
equal
deleted
inserted
replaced
280:345844caf048 | 281:1e3e169955b2 |
---|---|
233 | 233 |
234 def update(self, presence): | 234 def update(self, presence): |
235 """Request for VCard's nickname | 235 """Request for VCard's nickname |
236 return the cached nickname if exists, else get VCard | 236 return the cached nickname if exists, else get VCard |
237 """ | 237 """ |
238 to_jid = jid.JID(presence['from']) | 238 from_jid = jid.JID(presence['from']) |
239 x_elem = filter (lambda x:x.name == "x", presence.elements())[0] #We only want the "x" element | 239 x_elem = filter (lambda x:x.name == "x", presence.elements())[0] #We only want the "x" element |
240 for elem in x_elem.elements(): | 240 for elem in x_elem.elements(): |
241 if elem.name == 'photo': | 241 if elem.name == 'photo': |
242 hash = str(elem) | 242 hash = str(elem) |
243 old_avatar = self.plugin_parent.get_cache(to_jid, 'avatar') | 243 old_avatar = self.plugin_parent.get_cache(from_jid, 'avatar') |
244 if not old_avatar or old_avatar != hash: | 244 if not old_avatar or old_avatar != hash: |
245 debug(_('New avatar found, requesting vcard')) | 245 debug(_('New avatar found, requesting vcard')) |
246 self.plugin_parent.getCard(to_jid.userhost(), self.parent.profile) | 246 self.plugin_parent.getCard(from_jid.userhost(), self.parent.profile) |