do not remove a contact from roster when he goes offline and showoffline is True
This commit is contained in:
parent
276415f570
commit
028de148d3
1 changed files with 17 additions and 1 deletions
|
@ -314,7 +314,23 @@ class RosterWindow:
|
||||||
return
|
return
|
||||||
if contact.jid in gajim.to_be_removed[account]:
|
if contact.jid in gajim.to_be_removed[account]:
|
||||||
gajim.to_be_removed[account].remove(contact.jid)
|
gajim.to_be_removed[account].remove(contact.jid)
|
||||||
self.remove_contact(contact, account)
|
# JEP-0162
|
||||||
|
hide = True
|
||||||
|
if contact.sub in ('both', 'to', 'from'):
|
||||||
|
hide = False
|
||||||
|
elif contact.ask == 'subscribe':
|
||||||
|
hide = False
|
||||||
|
elif contact.name or len(contact.groups):
|
||||||
|
hide = False
|
||||||
|
|
||||||
|
showOffline = gajim.config.get('showoffline')
|
||||||
|
if (contact.show in ('offline', 'error') or hide) and \
|
||||||
|
not showOffline and (not _('Transports') in contact.groups or \
|
||||||
|
gajim.connections[account].connected < 2) and \
|
||||||
|
not gajim.awaiting_events[account].has_key(contact.jid):
|
||||||
|
self.remove_contact(contact, account)
|
||||||
|
else:
|
||||||
|
self.draw_contact(contact.jid, account)
|
||||||
|
|
||||||
def remove_contact(self, contact, account):
|
def remove_contact(self, contact, account):
|
||||||
'''Remove a contact from the roster'''
|
'''Remove a contact from the roster'''
|
||||||
|
|
Loading…
Add table
Reference in a new issue