count events from other resources to decide if we must remove contact from roster or not. see #2657
This commit is contained in:
parent
f041f8dd5e
commit
1377aa875c
1 changed files with 10 additions and 2 deletions
|
@ -465,11 +465,19 @@ 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')
|
||||||
|
|
||||||
|
nb_events = 0
|
||||||
|
jid_list = [contact.jid]
|
||||||
|
if contact.get_full_jid() != contact.jid:
|
||||||
|
jid_list.append(contact.get_full_jid())
|
||||||
|
for jid in jid_list:
|
||||||
|
# dont't count printed_chat messages
|
||||||
|
nb_events += gajim.events.get_nb_roster_events(account, jid, ['chat'])
|
||||||
|
|
||||||
if (_('Transports') in contact.groups and not show_transports) or \
|
if (_('Transports') in contact.groups and not show_transports) or \
|
||||||
((contact.show in ('offline', 'error') or hide) and not show_offline and \
|
((contact.show in ('offline', 'error') or hide) 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 nb_events == 0:
|
||||||
len(gajim.events.get_events(account, contact.jid, ['chat'])) == 0:
|
|
||||||
self.remove_contact(contact, account)
|
self.remove_contact(contact, account)
|
||||||
else:
|
else:
|
||||||
self.draw_contact(contact.jid, account)
|
self.draw_contact(contact.jid, account)
|
||||||
|
|
Loading…
Add table
Reference in a new issue