diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-10-10 14:52:32 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-10-10 14:58:50 +0200 |
commit | a66e3903df7d7be35f147fbd91b018dc63411484 (patch) | |
tree | 8ce57905ae1f08c19f406bd6f17a16541049c62d | |
parent | d62a2170e1aef7a768522222d2f5f4d2a26d5a1b (diff) | |
download | poezio-a66e3903df7d7be35f147fbd91b018dc63411484.tar.gz poezio-a66e3903df7d7be35f147fbd91b018dc63411484.tar.bz2 poezio-a66e3903df7d7be35f147fbd91b018dc63411484.tar.xz poezio-a66e3903df7d7be35f147fbd91b018dc63411484.zip |
MUC-PMs: correctly loop through bookmarks
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/core/handlers.py | 13 |
1 files changed, 7 insertions, 6 deletions
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 |