From 2354e7d10203f0561f3c4d6657f044b3938b8db1 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 13 Feb 2016 14:48:14 +0100 Subject: Fix tab-specific options in the OTR plugin (specifically, require_encryption and log) --- plugins/otr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/otr.py b/plugins/otr.py index 12dd1877..3942bcd8 100644 --- a/plugins/otr.py +++ b/plugins/otr.py @@ -535,17 +535,17 @@ class Plugin(BasePlugin): """ Retrieve or create an OTR context """ - jid = safeJID(jid).full - if not jid in self.contexts: + jid = safeJID(jid) + if not jid.full in self.contexts: flags = POLICY_FLAGS.copy() require = self.config.get_by_tabname('require_encryption', - jid, default=False) + jid.bare, default=False) flags['REQUIRE_ENCRYPTION'] = require - logging_policy = self.config.get_by_tabname('log', jid, default=False) - self.contexts[jid] = PoezioContext(self.account, jid, self.core.xmpp, self.core) - self.contexts[jid].log = 1 if logging_policy else 0 - self.contexts[jid].flags = flags - return self.contexts[jid] + logging_policy = self.config.get_by_tabname('log', jid.bare , default=False) + self.contexts[jid.full] = PoezioContext(self.account, jid.full, self.core.xmpp, self.core) + self.contexts[jid.full].log = 1 if logging_policy else 0 + self.contexts[jid.full].flags = flags + return self.contexts[jid.full] def on_conversation_msg(self, msg, tab): """ -- cgit v1.2.3