comparison sat/memory/encryption.py @ 3180:826bca181226

core (memory/encryption): "isEncryptionRequested" helper method: this method is similar to "isEncrypted" but for outgoing messages.
author Goffi <goffi@goffi.org>
date Sun, 23 Feb 2020 17:48:26 +0100
parents d073d82d9044
children 0469c53ed5dd
comparison
equal deleted inserted replaced
3179:84a94b385760 3180:826bca181226
435 @param mess_data(dict): message data as used in post treat workflow 435 @param mess_data(dict): message data as used in post treat workflow
436 """ 436 """
437 mess_data[C.MESS_KEY_ENCRYPTED] = True 437 mess_data[C.MESS_KEY_ENCRYPTED] = True
438 return mess_data 438 return mess_data
439 439
440 def isEncryptionRequested(self, mess_data):
441 """Helper method to check if encryption is requested in an outgoind message
442
443 @param mess_data(dict): message data for outgoing message
444 @return (bool): True if the encryption flag is present
445 """
446 return bool(mess_data.get(C.MESS_KEY_ENCRYPTION, False))
447
440 def isEncrypted(self, mess_data): 448 def isEncrypted(self, mess_data):
441 """Helper method to check if a message has the e2e encrypted flag 449 """Helper method to check if an incoming message has the e2e encrypted flag
442 450
443 @param mess_data(dict): message data 451 @param mess_data(dict): message data
444 @return (bool): True if the encrypted flag is present 452 @return (bool): True if the encrypted flag is present
445 """ 453 """
446 return mess_data.get(C.MESS_KEY_ENCRYPTED, False) 454 return mess_data.get(C.MESS_KEY_ENCRYPTED, False)