don't ask vcard twice to the user when we enter a groupchat (one to fake jid and one to real jid)
This commit is contained in:
parent
d01c4983ad
commit
eca640f2f7
|
@ -1670,11 +1670,14 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
# contact has no avatar
|
# contact has no avatar
|
||||||
puny_nick = helpers.sanitize_filename(resource)
|
puny_nick = helpers.sanitize_filename(resource)
|
||||||
gajim.interface.remove_avatar_files(jid_stripped, puny_nick)
|
gajim.interface.remove_avatar_files(jid_stripped, puny_nick)
|
||||||
if self.vcard_shas.has_key(who): # Verify sha cached in mem
|
# if it's a gc presence, don't ask vcard here. We may ask it to
|
||||||
|
# real jid in gui part.
|
||||||
|
if self.vcard_shas.has_key(who) and not is_gc:
|
||||||
|
# Verify sha cached in mem
|
||||||
if avatar_sha != self.vcard_shas[who]:
|
if avatar_sha != self.vcard_shas[who]:
|
||||||
# avatar has been updated
|
# avatar has been updated
|
||||||
self.request_vcard(who, True)
|
self.request_vcard(who, True)
|
||||||
else: # Verify sha cached in hdd
|
elif not is_gc: # Verify sha cached in hdd
|
||||||
cached_vcard = self.get_cached_vcard(who, True)
|
cached_vcard = self.get_cached_vcard(who, True)
|
||||||
if cached_vcard and cached_vcard.has_key('PHOTO') and \
|
if cached_vcard and cached_vcard.has_key('PHOTO') and \
|
||||||
cached_vcard['PHOTO'].has_key('SHA'):
|
cached_vcard['PHOTO'].has_key('SHA'):
|
||||||
|
|
|
@ -1022,7 +1022,10 @@ class GroupchatControl(ChatControlBase):
|
||||||
fjid += '/' + resource
|
fjid += '/' + resource
|
||||||
else:
|
else:
|
||||||
fjid = self.room_jid + '/' + nick
|
fjid = self.room_jid + '/' + nick
|
||||||
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(fjid, True)
|
if j:
|
||||||
|
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(fjid)
|
||||||
|
else:
|
||||||
|
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(fjid, True)
|
||||||
if pixbuf == 'ask':
|
if pixbuf == 'ask':
|
||||||
if j:
|
if j:
|
||||||
gajim.connections[self.account].request_vcard(fjid)
|
gajim.connections[self.account].request_vcard(fjid)
|
||||||
|
|
Loading…
Reference in New Issue