This commit is contained in:
Nikos Kouremenos 2005-11-01 13:05:51 +00:00
parent 0f9f404000
commit 63bcfc3054
1 changed files with 3 additions and 3 deletions

View File

@ -247,7 +247,7 @@ class Connection:
if vc.getTag('vCard').getNamespace() == common.xmpp.NS_VCARD: if vc.getTag('vCard').getNamespace() == common.xmpp.NS_VCARD:
card = vc.getChildren()[0] card = vc.getChildren()[0]
vcard = self.node_to_dict(card) vcard = self.node_to_dict(card)
if vcard.has_key('PHOTO') and type(vcard['PHOTO']) == type({}) and \ if vcard and vcard.has_key('PHOTO') and type(vcard['PHOTO']) == type({}) and \
vcard['PHOTO'].has_key('BINVAL'): vcard['PHOTO'].has_key('BINVAL'):
photo = vcard['PHOTO']['BINVAL'] photo = vcard['PHOTO']['BINVAL']
avatar_sha = sha.sha(photo).hexdigest() avatar_sha = sha.sha(photo).hexdigest()
@ -1272,7 +1272,7 @@ class Connection:
prio = unicode(gajim.config.get_per('accounts', self.name, prio = unicode(gajim.config.get_per('accounts', self.name,
'priority')) 'priority'))
vcard = self.get_cached_vcard(jid) vcard = self.get_cached_vcard(jid)
if vcard.has_key('PHOTO') and vcard['PHOTO'].has_key('SHA'): if vcard and vcard.has_key('PHOTO') and vcard['PHOTO'].has_key('SHA'):
self.vcard_sha = vcard['PHOTO']['SHA'] self.vcard_sha = vcard['PHOTO']['SHA']
p = common.xmpp.Presence(typ = None, priority = prio, show = sshow) p = common.xmpp.Presence(typ = None, priority = prio, show = sshow)
p = self.add_sha(p) p = self.add_sha(p)
@ -1911,7 +1911,7 @@ class Connection:
c = f.read() c = f.read()
card = common.xmpp.Node(node = c) card = common.xmpp.Node(node = c)
vcard = self.node_to_dict(card) vcard = self.node_to_dict(card)
if vcard.has_key('PHOTO') and vcard['PHOTO'].has_key('SHA'): if vcard and vcard.has_key('PHOTO') and vcard['PHOTO'].has_key('SHA'):
cached_sha = vcard['PHOTO']['SHA'] cached_sha = vcard['PHOTO']['SHA']
if self.vcard_shas.has_key(jid) and self.vcard_shas[jid] != \ if self.vcard_shas.has_key(jid) and self.vcard_shas[jid] != \
cached_sha: cached_sha: