changeset 2752:1fa615faec8b

core (constants): added a constant for "encrypted"
author Goffi <goffi@goffi.org>
date Fri, 04 Jan 2019 18:46:02 +0100
parents 286a32a187e7
children 3dd265d281e1
files sat/core/constants.py sat/memory/encryption.py
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/constants.py	Fri Jan 04 18:44:43 2019 +0100
+++ b/sat/core/constants.py	Fri Jan 04 18:46:02 2019 +0100
@@ -121,9 +121,14 @@
     )
     MESS_TYPE_ALL = MESS_TYPE_STANDARD + (MESS_TYPE_INFO, MESS_TYPE_AUTO)
 
-    MESS_EXTRA_INFO = "info_type"
+    MESS_EXTRA_INFO = u"info_type"
+    EXTRA_INFO_DECR_ERR = u"DECRYPTION_ERROR"
 
-    MESS_KEY_ENCRYPTION = "ENCRYPTION"
+    # encryption is a key for plugins
+    MESS_KEY_ENCRYPTION = u"ENCRYPTION"
+    # encrypted is a key for frontends
+    MESS_KEY_ENCRYPTED = u"encrypted"
+    MESS_KEY_TRUSTED = u"trusted"
 
     ## Chat ##
     CHAT_ONE2ONE = "one2one"
--- a/sat/memory/encryption.py	Fri Jan 04 18:44:43 2019 +0100
+++ b/sat/memory/encryption.py	Fri Jan 04 18:46:02 2019 +0100
@@ -380,7 +380,7 @@
         the plugin
         @param mess_data(dict): message data as used in post treat workflow
         """
-        mess_data['encrypted'] = True
+        mess_data[C.MESS_KEY_ENCRYPTED] = True
         return mess_data
 
     def markAsTrusted(self, mess_data):
@@ -390,7 +390,7 @@
         the plugin
         @param mess_data(dict): message data as used in post treat workflow
         """
-        mess_data['trusted'] = True
+        mess_data[C.MESS_KEY_TRUSTED] = True
         return mess_data
 
     def markAsUntrusted(self, mess_data):