core (memory/encryption): new "isEncrypted" method to check if encrypted flag is set in message data
This commit is contained in:
parent
6a7d247754
commit
8fa4cd0f86
1 changed files with 12 additions and 3 deletions
|
|
@ -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
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue