From 342f24bfb00ad867f15767f38863302fb2decd07 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 18 Mar 2015 13:36:10 +0100 Subject: Fix the OTR timeout message for dynamic tabs. --- plugins/otr.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/plugins/otr.py b/plugins/otr.py index 6f68fa2c..9ef13c8d 100644 --- a/plugins/otr.py +++ b/plugins/otr.py @@ -875,21 +875,16 @@ class Plugin(BasePlugin): """ Start an otr conversation with a contact """ - otr = self.get_context(name) secs = self.config.get('timeout', 3) - if isinstance(tab, DynamicConversationTab) and tab.locked_resource: - was_locked = True - else: - was_locked = False def notify_otr_timeout(): - nonlocal name - otr = self.get_context(name) - if isinstance(tab, DynamicConversationTab) and not was_locked: + tab_name = tab.name + otr = self.get_context(tab_name) + if isinstance(tab, DynamicConversationTab): if tab.locked_resource: - name = safeJID(tab.name) - name.resource = tab.locked_resource - name = name.full - otr = self.get_context(name) + tab_name = safeJID(tab.name) + tab_name.resource = tab.locked_resource + tab_name = tab_name.full + otr = self.get_context(tab_name) if otr.state != STATE_ENCRYPTED: format_dict['secs'] = secs text = OTR_NOT_ENABLED % format_dict -- cgit v1.2.3