comparison sat/memory/encryption.py @ 4051:c23cad65ae99

core: renamed `messageReceived` trigger to `message_received`
author Goffi <goffi@goffi.org>
date Mon, 29 May 2023 13:32:08 +0200
parents 524856bd7b19
children
comparison
equal deleted inserted replaced
4050:199473ffe4ea 4051:c23cad65ae99
460 ## Misc ## 460 ## Misc ##
461 461
462 def mark_as_encrypted(self, mess_data, namespace): 462 def mark_as_encrypted(self, mess_data, namespace):
463 """Helper method to mark a message as having been e2e encrypted. 463 """Helper method to mark a message as having been e2e encrypted.
464 464
465 This should be used in the post_treat workflow of messageReceived trigger of 465 This should be used in the post_treat workflow of message_received trigger of
466 the plugin 466 the plugin
467 @param mess_data(dict): message data as used in post treat workflow 467 @param mess_data(dict): message data as used in post treat workflow
468 @param namespace(str): namespace of the algorithm used for encrypting the message 468 @param namespace(str): namespace of the algorithm used for encrypting the message
469 """ 469 """
470 mess_data['extra'][C.MESS_KEY_ENCRYPTED] = True 470 mess_data['extra'][C.MESS_KEY_ENCRYPTED] = True
514 514
515 515
516 def mark_as_trusted(self, mess_data): 516 def mark_as_trusted(self, mess_data):
517 """Helper methor to mark a message as sent from a trusted entity. 517 """Helper methor to mark a message as sent from a trusted entity.
518 518
519 This should be used in the post_treat workflow of messageReceived trigger of 519 This should be used in the post_treat workflow of message_received trigger of
520 the plugin 520 the plugin
521 @param mess_data(dict): message data as used in post treat workflow 521 @param mess_data(dict): message data as used in post treat workflow
522 """ 522 """
523 mess_data[C.MESS_KEY_TRUSTED] = True 523 mess_data[C.MESS_KEY_TRUSTED] = True
524 return mess_data 524 return mess_data
525 525
526 def mark_as_untrusted(self, mess_data): 526 def mark_as_untrusted(self, mess_data):
527 """Helper methor to mark a message as sent from an untrusted entity. 527 """Helper methor to mark a message as sent from an untrusted entity.
528 528
529 This should be used in the post_treat workflow of messageReceived trigger of 529 This should be used in the post_treat workflow of message_received trigger of
530 the plugin 530 the plugin
531 @param mess_data(dict): message data as used in post treat workflow 531 @param mess_data(dict): message data as used in post treat workflow
532 """ 532 """
533 mess_data['trusted'] = False 533 mess_data['trusted'] = False
534 return mess_data 534 return mess_data