fix a tb
This commit is contained in:
parent
7671dae8b8
commit
83ffab141f
11
src/gajim.py
11
src/gajim.py
|
@ -627,14 +627,15 @@ class Interface:
|
|||
def handle_event_vcard(self, account, vcard):
|
||||
'''vcard holds the vcard data'''
|
||||
jid = vcard['jid']
|
||||
resource = vcard['resource']
|
||||
self.store_avatar(vcard)
|
||||
|
||||
# vcard window
|
||||
win = None
|
||||
if self.windows[account]['infos'].has_key(jid):
|
||||
win = self.windows[account]['infos'][jid]
|
||||
elif self.windows[account]['infos'].has_key(jid + '/' +vcard['resource']):
|
||||
win = self.windows[account]['infos'][jid + '/' + vcard['resource']]
|
||||
elif self.windows[account]['infos'].has_key(jid + '/' + resource):
|
||||
win = self.windows[account]['infos'][jid + '/' + resource]
|
||||
if win:
|
||||
win.set_values(vcard) #FIXME: maybe store all vcard data?
|
||||
|
||||
|
@ -642,10 +643,10 @@ class Interface:
|
|||
win = None
|
||||
if self.windows[account]['chats'].has_key(jid):
|
||||
win = self.windows[account]['chats'][jid]
|
||||
elif self.windows[account]['chats'].has_key(jid + '/' +vcard['resource']):
|
||||
win = self.windows[account]['chats'][jid + '/' + vcard['resource']]
|
||||
elif self.windows[account]['chats'].has_key(jid + '/' + resource):
|
||||
win = self.windows[account]['chats'][jid + '/' + resource]
|
||||
if win:
|
||||
win.show_avatar(jid)
|
||||
win.show_avatar(jid, resource)
|
||||
if self.remote is not None:
|
||||
self.remote.raise_signal('VcardInfo', (account, vcard))
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ timestamp, contact):
|
|||
def get_specific_unread(self, jid):
|
||||
return 0 # FIXME: always zero why??
|
||||
|
||||
def show_avatar(self, jid):
|
||||
def show_avatar(self, jid, resource):
|
||||
if self.plugin.avatar_pixbufs[jid] is None:
|
||||
return # contact has no avatar
|
||||
|
||||
|
@ -236,7 +236,7 @@ timestamp, contact):
|
|||
x = self.xmls[jid]
|
||||
else:
|
||||
# it can be xmls[jid/resource] if it's a vcard from pm
|
||||
jid_with_resource = jid + '/' + vcard['resource']
|
||||
jid_with_resource = jid + '/' + resource
|
||||
if self.xmls.has_key(jid_with_resource):
|
||||
x = self.xmls[jid_with_resource]
|
||||
|
||||
|
@ -388,7 +388,8 @@ timestamp, contact):
|
|||
#avatars in roster
|
||||
#print 'REQUESTING VCARD for', contact.jid
|
||||
else:
|
||||
self.show_avatar(contact.jid) # show avatar from stored place
|
||||
# show avatar from stored place
|
||||
self.show_avatar(contact.jid, contact.resource)
|
||||
|
||||
self.childs[contact.jid].connect('drag_data_received',
|
||||
self.on_drag_data_received, contact)
|
||||
|
|
Loading…
Reference in New Issue