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)
# Redraw parent too
gajim.interface.roster.draw_parent_contact(jid, self.account)
if (self.contact.show == 'offline' or self.contact.show == 'error'):
showOffline = gajim.config.get('showoffline')
if not showOffline and typ == 'chat' and \
len(gajim.contacts.get_contact(self.account, jid)) < 2:
if (self.contact.show in ('offline', 'error')):
show_offline = gajim.config.get('showoffline')
show_transports = gajim.config.get('show_transports_group')
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,
self.account)
elif typ == 'pm':

View File

@ -224,7 +224,8 @@ class RosterWindow:
return
if gajim.jid_is_transport(contact.jid):
# 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
contact.groups = [_('Transports')]
@ -382,7 +383,8 @@ class RosterWindow:
if contact.jid in gajim.newly_added[account]:
return
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
if contact.jid in gajim.to_be_removed[account]:
gajim.to_be_removed[account].remove(contact.jid)
@ -390,10 +392,12 @@ class RosterWindow:
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 \
not showOffline and (not _('Transports') in contact.groups or \
gajim.account_is_disconnected(account)) and \
(_('Transports') in contact.groups and not show_transports) or \
(not show_offline and (not _('Transports') in contact.groups or \
gajim.account_is_disconnected(account))) and \
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0:
self.remove_contact(contact, account)
else: