From 02dc38762e7060e006528ced0662eb4d8e158861 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 4 Jan 2019 18:46:02 +0100 Subject: [PATCH] core (constants): added a constant for "encrypted" --- sat/core/constants.py | 9 +++++++-- sat/memory/encryption.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sat/core/constants.py b/sat/core/constants.py index 7ca4d7ba..f98b9d27 100644 --- a/sat/core/constants.py +++ b/sat/core/constants.py @@ -121,9 +121,14 @@ class Const(object): ) 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" diff --git a/sat/memory/encryption.py b/sat/memory/encryption.py index 188ba621..fa34a0a8 100644 --- a/sat/memory/encryption.py +++ b/sat/memory/encryption.py @@ -380,7 +380,7 @@ class EncryptionHandler(object): 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 @@ class EncryptionHandler(object): 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):