From a66e3903df7d7be35f147fbd91b018dc63411484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 10 Oct 2019 14:52:32 +0200 Subject: MUC-PMs: correctly loop through bookmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/core/handlers.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'poezio/core/handlers.py') diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index 3ae9420b..1278e29e 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -117,15 +117,16 @@ class HandlerCore: if with_jid.bare in roster and roster[with_jid.bare].subscription != 'none': return False # then, check bookmarks - if with_jid.bare in self.core.bookmarks: - log.debug('MUC-PM from %s in bookmarks', with_jid) - return True + jid_bare = with_jid.bare + for bm in self.core.bookmarks: + if bm.jid.bare == jid_bare: + log.debug('MUC-PM from %s in bookmarks', with_jid) + return True # then, look whether we know the MUC JID for tab in self.core.get_tabs(tabs.MucTab): - if tab.jid.bare == with_jid.bare: + if tab.jid.bare == jid_bare: if with_jid.resource: - log.debug('MUC-PM from %s in known MucTab', - with_jid) + log.debug('MUC-PM from %s in known MucTab', with_jid) return True return None -- cgit v1.2.3