Some small tweaks to the roster visible_func
* Do not show transports when the account is disconnected. Fixes #4124 * Hide contacts with unconfirmed subscription when we only want to see online contacts. Fixes #4118
This commit is contained in:
parent
cb8cfbce06
commit
9ecf0e5fa9
|
@ -1260,9 +1260,6 @@ class RosterWindow:
|
||||||
if self.contact_has_pending_roster_events(contact, account):
|
if self.contact_has_pending_roster_events(contact, account):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if contact.ask:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if contact.show in ('offline', 'error'):
|
if contact.show in ('offline', 'error'):
|
||||||
if contact.jid in gajim.to_be_removed[account]:
|
if contact.jid in gajim.to_be_removed[account]:
|
||||||
return True
|
return True
|
||||||
|
@ -1290,10 +1287,13 @@ class RosterWindow:
|
||||||
if type_ == 'group':
|
if type_ == 'group':
|
||||||
group = jid
|
group = jid
|
||||||
if group == _('Transports'):
|
if group == _('Transports'):
|
||||||
return gajim.config.get('show_transports_group')
|
return gajim.config.get('show_transports_group') and \
|
||||||
|
(gajim.account_is_connected(account) or \
|
||||||
|
gajim.config.get('showoffline'))
|
||||||
if gajim.config.get('showoffline'):
|
if gajim.config.get('showoffline'):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
if self.regroup:
|
if self.regroup:
|
||||||
# C_ACCOUNT for groups depends on the order
|
# C_ACCOUNT for groups depends on the order
|
||||||
# accounts were connected
|
# accounts were connected
|
||||||
|
@ -1331,7 +1331,9 @@ class RosterWindow:
|
||||||
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
|
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
|
||||||
return self.contact_is_visible(contact, account)
|
return self.contact_is_visible(contact, account)
|
||||||
if type_ == 'agent':
|
if type_ == 'agent':
|
||||||
return gajim.config.get('show_transports_group')
|
return gajim.config.get('show_transports_group') and \
|
||||||
|
(gajim.account_is_connected(account) or \
|
||||||
|
gajim.config.get('showoffline'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _compareIters(self, model, iter1, iter2, data = None):
|
def _compareIters(self, model, iter1, iter2, data = None):
|
||||||
|
|
Loading…
Reference in New Issue