# HG changeset patch # User Goffi # Date 1582476506 -3600 # Node ID 826bca181226ed62cb0bbd0c6730d9b3185288f5 # Parent 84a94b38576081a8f9ea317ff2d233eab68d6fea core (memory/encryption): "isEncryptionRequested" helper method: this method is similar to "isEncrypted" but for outgoing messages. diff -r 84a94b385760 -r 826bca181226 sat/memory/encryption.py --- a/sat/memory/encryption.py Fri Feb 21 12:17:38 2020 +0100 +++ b/sat/memory/encryption.py Sun Feb 23 17:48:26 2020 +0100 @@ -437,8 +437,16 @@ mess_data[C.MESS_KEY_ENCRYPTED] = True return mess_data + def isEncryptionRequested(self, mess_data): + """Helper method to check if encryption is requested in an outgoind message + + @param mess_data(dict): message data for outgoing message + @return (bool): True if the encryption flag is present + """ + return bool(mess_data.get(C.MESS_KEY_ENCRYPTION, False)) + def isEncrypted(self, mess_data): - """Helper method to check if a message has the e2e encrypted flag + """Helper method to check if an incoming message has the e2e encrypted flag @param mess_data(dict): message data @return (bool): True if the encrypted flag is present