Cleaner way to check for 'show_avatars_in_roster'
This commit is contained in:
parent
4d675c42b1
commit
37ea4052e1
2 changed files with 10 additions and 12 deletions
|
@ -939,6 +939,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
model[iter][C_TEXT] = name
|
model[iter][C_TEXT] = name
|
||||||
|
|
||||||
def draw_avatar(self, nick):
|
def draw_avatar(self, nick):
|
||||||
|
if gajim.config.get('show_avatars_in_roster'):
|
||||||
|
return
|
||||||
model = self.list_treeview.get_model()
|
model = self.list_treeview.get_model()
|
||||||
iter = self.get_contact_iter(nick)
|
iter = self.get_contact_iter(nick)
|
||||||
if not iter:
|
if not iter:
|
||||||
|
@ -1195,7 +1197,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
affiliation = affiliation, jid = j, resource = resource)
|
affiliation = affiliation, jid = j, resource = resource)
|
||||||
gajim.contacts.add_gc_contact(self.account, gc_contact)
|
gajim.contacts.add_gc_contact(self.account, gc_contact)
|
||||||
self.draw_contact(nick)
|
self.draw_contact(nick)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(nick)
|
self.draw_avatar(nick)
|
||||||
# Do not ask avatar to irc rooms as irc transports reply with messages
|
# Do not ask avatar to irc rooms as irc transports reply with messages
|
||||||
server = gajim.get_server_from_jid(self.room_jid)
|
server = gajim.get_server_from_jid(self.room_jid)
|
||||||
|
|
|
@ -334,7 +334,6 @@ class RosterWindow:
|
||||||
model.append(i, (None, name, 'contact', jid, account, None,
|
model.append(i, (None, name, 'contact', jid, account, None,
|
||||||
None))
|
None))
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(jid, account)
|
self.draw_avatar(jid, account)
|
||||||
self.draw_account(account)
|
self.draw_account(account)
|
||||||
# Redraw parent to change icon
|
# Redraw parent to change icon
|
||||||
|
@ -395,7 +394,6 @@ class RosterWindow:
|
||||||
if gajim.groups[account][group]['expand']:
|
if gajim.groups[account][group]['expand']:
|
||||||
self.tree.expand_row(model.get_path(iterG), False)
|
self.tree.expand_row(model.get_path(iterG), False)
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(jid, account)
|
self.draw_avatar(jid, account)
|
||||||
self.draw_account(account)
|
self.draw_account(account)
|
||||||
# put the children under this iter
|
# put the children under this iter
|
||||||
|
@ -482,7 +480,6 @@ class RosterWindow:
|
||||||
jid = gajim.get_jid_from_account(account)
|
jid = gajim.get_jid_from_account(account)
|
||||||
if self.get_self_contact_iter(account):
|
if self.get_self_contact_iter(account):
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(jid, account)
|
self.draw_avatar(jid, account)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -499,7 +496,6 @@ class RosterWindow:
|
||||||
model.append(iterAcct, (None, gajim.nicks[account], 'self_contact', jid,
|
model.append(iterAcct, (None, gajim.nicks[account], 'self_contact', jid,
|
||||||
account, None, None))
|
account, None, None))
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(jid, account)
|
self.draw_avatar(jid, account)
|
||||||
|
|
||||||
def add_transport_to_roster(self, account, transport):
|
def add_transport_to_roster(self, account, transport):
|
||||||
|
@ -764,6 +760,8 @@ class RosterWindow:
|
||||||
|
|
||||||
def draw_avatar(self, jid, account):
|
def draw_avatar(self, jid, account):
|
||||||
'''draw the avatar'''
|
'''draw the avatar'''
|
||||||
|
if gajim.config.get('show_avatars_in_roster'):
|
||||||
|
return
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
iters = self.get_contact_iter(jid, account)
|
iters = self.get_contact_iter(jid, account)
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
if gajim.config.get('show_avatars_in_roster'):
|
||||||
|
@ -1934,7 +1932,6 @@ class RosterWindow:
|
||||||
|
|
||||||
def update_avatar_in_gui(self, jid, account):
|
def update_avatar_in_gui(self, jid, account):
|
||||||
# Update roster
|
# Update roster
|
||||||
if gajim.config.get('show_avatars_in_roster'):
|
|
||||||
self.draw_avatar(jid, account)
|
self.draw_avatar(jid, account)
|
||||||
# Update chat window
|
# Update chat window
|
||||||
if gajim.interface.msg_win_mgr.has_window(jid, account):
|
if gajim.interface.msg_win_mgr.has_window(jid, account):
|
||||||
|
|
Loading…
Add table
Reference in a new issue