summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-03-18 13:36:10 +0100
committermathieui <mathieui@mathieui.net>2015-03-18 13:36:10 +0100
commit342f24bfb00ad867f15767f38863302fb2decd07 (patch)
tree7da0eb38792bd5316fa959b9562cc31b33b45aba /plugins
parentcea4f3d189ab583b9b59d4556450b1460d1f9bb8 (diff)
downloadpoezio-342f24bfb00ad867f15767f38863302fb2decd07.tar.gz
poezio-342f24bfb00ad867f15767f38863302fb2decd07.tar.bz2
poezio-342f24bfb00ad867f15767f38863302fb2decd07.tar.xz
poezio-342f24bfb00ad867f15767f38863302fb2decd07.zip
Fix the OTR timeout message
for dynamic tabs.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/otr.py19
1 files 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