show our server in roster when we get a message from it, and hide it if show_transports_group is False. Fixes #2568
This commit is contained in:
parent
4500643eaf
commit
fafa2d0c0a
|
@ -62,6 +62,8 @@ class Contact:
|
||||||
def is_hidden_from_roster(self):
|
def is_hidden_from_roster(self):
|
||||||
'''if contact should not be visible in roster'''
|
'''if contact should not be visible in roster'''
|
||||||
# XEP-0162: http://www.xmpp.org/extensions/xep-0162.html
|
# XEP-0162: http://www.xmpp.org/extensions/xep-0162.html
|
||||||
|
if self.is_transport():
|
||||||
|
return False
|
||||||
if self.sub in ('both', 'to'):
|
if self.sub in ('both', 'to'):
|
||||||
return False
|
return False
|
||||||
if self.sub in ('none', 'from') and self.ask == 'subscribe':
|
if self.sub in ('none', 'from') and self.ask == 'subscribe':
|
||||||
|
|
|
@ -1170,10 +1170,12 @@ class Interface:
|
||||||
return
|
return
|
||||||
# no other event?
|
# no other event?
|
||||||
if not len(gajim.events.get_events(account, jid)):
|
if not len(gajim.events.get_events(account, jid)):
|
||||||
if not gajim.config.get('showoffline'):
|
|
||||||
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
||||||
jid)
|
jid)
|
||||||
if contact and contact.show in ('error', 'offline'):
|
show_transport = gajim.config.get('show_transports_group')
|
||||||
|
if contact and (contact.show in ('error', 'offline') and \
|
||||||
|
not gajim.config.get('showoffline') or (
|
||||||
|
gajim.jid_is_transport(jid) and not show_transport)):
|
||||||
self.roster.really_remove_contact(contact, account)
|
self.roster.really_remove_contact(contact, account)
|
||||||
self.roster.show_title()
|
self.roster.show_title()
|
||||||
self.roster.draw_contact(jid, account)
|
self.roster.draw_contact(jid, account)
|
||||||
|
|
|
@ -394,9 +394,9 @@ class RosterWindow:
|
||||||
|
|
||||||
show_offline = gajim.config.get('showoffline')
|
show_offline = gajim.config.get('showoffline')
|
||||||
show_transports = gajim.config.get('show_transports_group')
|
show_transports = gajim.config.get('show_transports_group')
|
||||||
if (contact.show in ('offline', 'error') or hide) and \
|
if (_('Transports') in contact.groups and not show_transports) or \
|
||||||
(_('Transports') in contact.groups and not show_transports) or \
|
(contact.show in ('offline', 'error') or hide and not show_offline and \
|
||||||
(not show_offline and (not _('Transports') in contact.groups or \
|
(not _('Transports') in contact.groups or \
|
||||||
gajim.account_is_disconnected(account))) and \
|
gajim.account_is_disconnected(account))) and \
|
||||||
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0:
|
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0:
|
||||||
self.remove_contact(contact, account)
|
self.remove_contact(contact, account)
|
||||||
|
|
Loading…
Reference in New Issue