diff --git a/sat/memory/encryption.py b/sat/memory/encryption.py index 82feb970..82cc3e02 100644 --- a/sat/memory/encryption.py +++ b/sat/memory/encryption.py @@ -430,17 +430,26 @@ class EncryptionHandler(object): def markAsEncrypted(self, mess_data): """Helper method to mark a message as having been e2e encrypted. - This should be used in the post_treat workflow of MessageReceived trigger of + This should be used in the post_treat workflow of messageReceived trigger of the plugin @param mess_data(dict): message data as used in post treat workflow """ mess_data[C.MESS_KEY_ENCRYPTED] = True return mess_data + def isEncrypted(self, mess_data): + """Helper method to check if a message has the e2e encrypted flag + + @param mess_data(dict): message data + @return (bool): True if the encrypted flag is present + """ + return mess_data.get(C.MESS_KEY_ENCRYPTED, False) + + def markAsTrusted(self, mess_data): """Helper methor to mark a message as sent from a trusted entity. - This should be used in the post_treat workflow of MessageReceived trigger of + This should be used in the post_treat workflow of messageReceived trigger of the plugin @param mess_data(dict): message data as used in post treat workflow """ @@ -450,7 +459,7 @@ class EncryptionHandler(object): def markAsUntrusted(self, mess_data): """Helper methor to mark a message as sent from an untrusted entity. - This should be used in the post_treat workflow of MessageReceived trigger of + This should be used in the post_treat workflow of messageReceived trigger of the plugin @param mess_data(dict): message data as used in post treat workflow """