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:
Yann Leboulanger 2007-05-13 08:11:32 +00:00
parent d01c4983ad
commit eca640f2f7
2 changed files with 9 additions and 3 deletions

View File

@ -1670,11 +1670,14 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
# contact has no avatar
puny_nick = helpers.sanitize_filename(resource)
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]:
# avatar has been updated
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)
if cached_vcard and cached_vcard.has_key('PHOTO') and \
cached_vcard['PHOTO'].has_key('SHA'):

View File

@ -1022,7 +1022,10 @@ class GroupchatControl(ChatControlBase):
fjid += '/' + resource
else:
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 j:
gajim.connections[self.account].request_vcard(fjid)