# HG changeset patch # User souliane # Date 1410183851 -7200 # Node ID ad18eb65b6dba6913f6742018cf6cf0cb32bf7d7 # Parent d02335553b5dfd45601f25b17108752e5793563e browser_side (plugin OTR): forbid to start an OTR session if the contact is not connected diff -r d02335553b5d -r ad18eb65b6db src/browser/sat_browser/plugin_sec_otr.py --- a/src/browser/sat_browser/plugin_sec_otr.py Mon Sep 08 15:32:33 2014 +0200 +++ b/src/browser/sat_browser/plugin_sec_otr.py Mon Sep 08 15:44:11 2014 +0200 @@ -87,6 +87,8 @@ QUERY_KEY = D_("You already have a private key, but to start the conversation will still require a couple of seconds.{eol}{eol}") QUERY_CONFIRM = D_("Press OK to start now the encryption.") +ACTION_NA_TITLE = D_("Impossible action") +ACTION_NA = D_("Your correspondent must be connected to start an OTR conversation with him.") DEFAULT_POLICY_FLAGS = { 'ALLOW_V2': True, @@ -501,6 +503,9 @@ try: other_jid = menu_data['jid'] + if other_jid.bare not in self.host.contact_panel.connected: + dialog.InfoDialog(ACTION_NA_TITLE, ACTION_NA, AddStyleName="maxWidthLimit").show() + return self.fixResource(other_jid, cb) except KeyError: log.error(_("jid key is not present !"))