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