show transport if they have awaiting events, even if show_transport is off. fixes #2568

This commit is contained in:
Yann Leboulanger 2006-10-16 20:05:09 +00:00
parent 39688db977
commit fa1be18664
2 changed files with 16 additions and 10 deletions

View File

@ -1701,10 +1701,12 @@ class ChatControl(ChatControlBase):
gajim.interface.roster.draw_contact(jid, self.account) gajim.interface.roster.draw_contact(jid, self.account)
# Redraw parent too # Redraw parent too
gajim.interface.roster.draw_parent_contact(jid, self.account) gajim.interface.roster.draw_parent_contact(jid, self.account)
if (self.contact.show == 'offline' or self.contact.show == 'error'): if (self.contact.show in ('offline', 'error')):
showOffline = gajim.config.get('showoffline') show_offline = gajim.config.get('showoffline')
if not showOffline and typ == 'chat' and \ show_transports = gajim.config.get('show_transports_group')
len(gajim.contacts.get_contact(self.account, jid)) < 2: if (not show_transports and gajim.jid_is_transport(jid)) or \
(not show_offline and typ == 'chat' and \
len(gajim.contacts.get_contact(self.account, jid)) < 2):
gajim.interface.roster.really_remove_contact(self.contact, gajim.interface.roster.really_remove_contact(self.contact,
self.account) self.account)
elif typ == 'pm': elif typ == 'pm':

View File

@ -224,7 +224,8 @@ class RosterWindow:
return return
if gajim.jid_is_transport(contact.jid): if gajim.jid_is_transport(contact.jid):
# if jid is transport, check if we wanna show it in roster # if jid is transport, check if we wanna show it in roster
if not gajim.config.get('show_transports_group'): if not gajim.config.get('show_transports_group') and \
not gajim.events.get_nb_roster_events(account, contact.jid):
return return
contact.groups = [_('Transports')] contact.groups = [_('Transports')]
@ -382,7 +383,8 @@ class RosterWindow:
if contact.jid in gajim.newly_added[account]: if contact.jid in gajim.newly_added[account]:
return return
if gajim.jid_is_transport(contact.jid) and gajim.account_is_connected( if gajim.jid_is_transport(contact.jid) and gajim.account_is_connected(
account): # It's an agent account) and gajim.config.get('show_transports_group'):
# It's an agent and we show them
return return
if contact.jid in gajim.to_be_removed[account]: if contact.jid in gajim.to_be_removed[account]:
gajim.to_be_removed[account].remove(contact.jid) gajim.to_be_removed[account].remove(contact.jid)
@ -390,11 +392,13 @@ class RosterWindow:
hide = contact.is_hidden_from_roster() hide = contact.is_hidden_from_roster()
showOffline = gajim.config.get('showoffline') show_offline = gajim.config.get('showoffline')
show_transports = gajim.config.get('show_transports_group')
if (contact.show in ('offline', 'error') or hide) and \ if (contact.show in ('offline', 'error') or hide) and \
not showOffline and (not _('Transports') in contact.groups or \ (_('Transports') in contact.groups and not show_transports) or \
gajim.account_is_disconnected(account)) and \ (not show_offline and (not _('Transports') in contact.groups or \
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0: gajim.account_is_disconnected(account))) and \
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0:
self.remove_contact(contact, account) self.remove_contact(contact, account)
else: else:
self.draw_contact(contact.jid, account) self.draw_contact(contact.jid, account)