From 0828f88e2967ec9214f46a6fb94795a02ec84fd1 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 4 Apr 2006 19:32:12 +0000
Subject: [PATCH] fix logic. Fixes #1798

---
 src/common/contacts.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/common/contacts.py b/src/common/contacts.py
index 9aa7bc167d..be377e205c 100644
--- a/src/common/contacts.py
+++ b/src/common/contacts.py
@@ -144,7 +144,9 @@ class Contacts:
 		contacts = self._contacts[account][contact.jid]
 		# We had only one that was offline, remove it
 		if len(contacts) == 1 and contacts[0].show == 'offline':
-			self.remove_contact(account, contacts[0])
+			# Do not use self.remove_contact: it deteles
+			# self._contacts[account][contact.jid]
+			contacts.remove(contacts[0])
 		# If same JID with same resource already exists, use the new one
 		for c in contacts:
 			if c.resource == contact.resource:
-- 
GitLab