[sef] ask avatars on startup ace

This commit is contained in:
Nikos Kouremenos 2005-11-15 23:26:22 +00:00
parent c60e1d9444
commit fac2a002c7
3 changed files with 10 additions and 9 deletions

View File

@ -159,6 +159,7 @@ class Config:
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
'show_status_msgs_in_roster': [opt_bool, True, _('If True, Gajim will display the status message, if not empty, for every contact under the contact name in roster window')],
'show_avatars_in_roster': [opt_bool, True],
'ask_avatars_on_startup': [opt_bool, True, _('If True, Gajim will ask for avatar each contact that did not have an avatar last time or has one cache that is too old.')],
'print_status_in_chats': [opt_bool, True, _('If False, you will no longer see status line in chats when a contact changes his or her status and/or his status message.')],
}

View File

@ -424,8 +424,8 @@ def get_scaled_pixbuf(pixbuf, type):
def get_avatar_pixbuf_from_cache(jid):
'''checks if jid has cached avatar and if that avatar is valid image
(can be shown)
return None if there is no image in vcard
return 'ask' if vcard is too old or if we don't have the vcard'''
returns None if there is no image in vcard
returns 'ask' if vcard is old (we have new sha) or if we don't have the vcard'''
if jid not in os.listdir(gajim.VCARDPATH):
return 'ask'

View File

@ -646,13 +646,13 @@ class RosterWindow:
else:
ishidden = True
gajim.groups[account][g] = { 'expand': ishidden }
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(ji)
if pixbuf == 'ask':
jid_with_resource = contact1.jid
if contact1.resource:
jid_with_resource += '/' + contact1.resource
gajim.connections[account].request_vcard(jid_with_resource)
if gajim.config.get('ask_avatars_on_startup'):
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(ji)
if pixbuf == 'ask':
jid_with_resource = contact1.jid
if contact1.resource:
jid_with_resource += '/' + contact1.resource
gajim.connections[account].request_vcard(jid_with_resource)
def chg_contact_status(self, contact, show, status, account):
'''When a contact changes his or her status'''