From d0f775864745459d058257232f8c15a26be76a28 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Fri, 31 Mar 2006 17:54:52 +0000
Subject: [PATCH] clean common.contacts._contacts when we remove a contact.
 Fixes #1788

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

diff --git a/src/common/contacts.py b/src/common/contacts.py
index 1f2ad11277..b98a8906d8 100644
--- a/src/common/contacts.py
+++ b/src/common/contacts.py
@@ -159,6 +159,8 @@ class Contacts:
 			return
 		if contact in self._contacts[account][contact.jid]:
 			self._contacts[account][contact.jid].remove(contact)
+		if len(self._contacts[account][contact.jid]) == 0:
+			del self._contacts[account][contact.jid]
 
 	def remove_jid(self, account, jid):
 		'''Removes all contacts for a given jid'''
-- 
GitLab