From 028de148d3f24043dabc4b018117c89560949be6 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 30 Mar 2006 18:07:56 +0000 Subject: [PATCH] do not remove a contact from roster when he goes offline and showoffline is True --- src/roster_window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/roster_window.py b/src/roster_window.py index 7ff13294a..da84a78c4 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -314,7 +314,23 @@ class RosterWindow: return if contact.jid in gajim.to_be_removed[account]: 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): '''Remove a contact from the roster'''