changeset 535:331cb6ea0235

browser side (plugin otr): C.MESS_TYPE_INFO is used instead of "headline" for informational message
author Goffi <goffi@goffi.org>
date Fri, 05 Sep 2014 19:29:35 +0200
parents d2bf317b2d28
children 048ae7314156
files src/browser/sat_browser/plugin_sec_otr.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/plugin_sec_otr.py	Fri Sep 05 19:29:35 2014 +0200
+++ b/src/browser/sat_browser/plugin_sec_otr.py	Fri Sep 05 19:29:35 2014 +0200
@@ -90,7 +90,7 @@
             if self.state == otr.context.STATE_ENCRYPTED:
                 log.warning(u"Received unencrypted message in an encrypted context (from %(jid)s)" % {'jid': self.peer.full()})
                 feedback = _(u"WARNING: received unencrypted data in a supposedly encrypted context"),
-                self.host.newMessageCb(self.peer, feedback, "headline", self.host.whoami, {})
+                self.host.newMessageCb(self.peer, feedback, C.MESS_TYPE_INFO, self.host.whoami, {})
         self.host.newMessageCb(self.peer, msg, "chat", self.host.whoami, {})
 
     def sendMessageCb(self, msg, meta=None):
@@ -129,7 +129,7 @@
             elif msg_state == otr.context.STATE_FINISHED:
                 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, {})
+        self.host.newMessageCb(self.peer, feedback % other_jid_s, C.MESS_TYPE_INFO, self.host.whoami, {})
 
     def setCurrentTrust(self, new_trust='', act='asked', type_='trust'):
         log.debug("setCurrentTrust: trust={trust}, act={act}, type={type}".format(type=type_, trust=new_trust, act=act))
@@ -150,7 +150,7 @@
         otr.context.Context.setCurrentTrust(self, new_trust)
         if old_trust != new_trust:
             feedback = _("The privacy status of the current conversation is now: {state}").format(state='Private' if new_trust else 'Unverified')
-            self.host.newMessageCb(self.peer, feedback, "headline", self.host.whoami, {})
+            self.host.newMessageCb(self.peer, feedback, C.MESS_TYPE_INFO, self.host.whoami, {})
 
     def fingerprintAuthCb(self):
         """OTR v2 authentication using manual fingerprint comparison"""
@@ -379,7 +379,7 @@
         def cb(other_jid):
             def not_available():
                 if not finish:
-                    self.host.newMessageCb(other_jid, FEEDBACK_NOT_PRIVATE % other_jid.full(), "headline", self.host.whoami, {})
+                    self.host.newMessageCb(other_jid, FEEDBACK_NOT_PRIVATE % other_jid.full(), C.MESS_TYPE_INFO, self.host.whoami, {})
 
             priv_key = self.context_manager.account.privkey
             if priv_key is None: