don't show contact in roster if account is offline and no pending events and show_offline is False. fixes #2618

This commit is contained in:
Yann Leboulanger 2006-11-01 20:12:08 +00:00
parent f0f5243e32
commit 4c64eb6cce
1 changed files with 5 additions and 2 deletions

View File

@ -215,6 +215,7 @@ class RosterWindow:
showOffline = gajim.config.get('showoffline')
model = self.tree.get_model()
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
nb_events = gajim.events.get_nb_roster_events(account, contact.jid)
if not contact:
return
# If contact already in roster, do not add it
@ -225,10 +226,12 @@ 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') and \
not gajim.events.get_nb_roster_events(account, contact.jid):
if not gajim.config.get('show_transports_group') and not nb_events:
return
contact.groups = [_('Transports')]
elif not showOffline and not gajim.account_is_connected(account) and \
nb_events == 0:
return
# XEP-0162
hide = contact.is_hidden_from_roster()