diff src/browser/sat_browser/plugin_sec_otr.py @ 531:793f12d1f970

browser_side (plugin OTR): change some feedback messages
author souliane <souliane@mailoo.org>
date Fri, 05 Sep 2014 12:08:55 +0200
parents 1735aaeac652
children 19fc2ebc02dd
line wrap: on
line diff
--- a/src/browser/sat_browser/plugin_sec_otr.py	Fri Sep 05 11:53:55 2014 +0200
+++ b/src/browser/sat_browser/plugin_sec_otr.py	Fri Sep 05 12:08:55 2014 +0200
@@ -109,10 +109,10 @@
             return
 
         elif status == otr.context.STATUS_SEND_QUERY:
-            if msg_state in (otr.context.STATE_PLAINTEXT, otr.context.STATE_FINISHED):
+            if msg_state == otr.context.STATE_ENCRYPTED:
+                feedback = _('Attempting to refresh the private conversation with %s...')
+            else:
                 feedback = _('Attempting to start a private conversation with %s...')
-            elif msg_state == otr.context.STATE_ENCRYPTED:
-                feedback = _('Attempting to refresh the private conversation with %s...')
 
         elif status == otr.context.STATUS_AKE_SUCCESS:
             trusted_str = _(u"Verified") if self.getCurrentTrust() else _(u"Unverified")
@@ -125,9 +125,9 @@
             if msg_state == otr.context.STATE_PLAINTEXT:
                 feedback = FEEDBACK_NOT_PRIVATE
             elif msg_state == otr.context.STATE_ENCRYPTED:
-                feedback = _("%s has ended his/her private conversation with you; you should do the same.")
+                log.error(_("OTR session ended but the context's state is still 'encrypted'!"))
             elif msg_state == otr.context.STATE_FINISHED:
-                feedback = _("Private conversation with %s lost.")
+                feedback = _("%s has ended his/her private conversation with you; you should do the same.")
 
         self.host.newMessageCb(self.peer, feedback % other_jid_s, "headline", self.host.whoami, {})