diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index 8fedb33e..1e2eff2c 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -1319,7 +1319,7 @@ class SatMessageProtocol(xmppim.MessageProtocol): def _on_message_start_workflow(self, cont, client, message_elt, post_treat): """Parse message and do post treatments - It is the first callback called after messageReceived trigger + It is the first callback called after message_received trigger @param cont(bool): workflow will continue only if this is True @param message_elt(domish.Element): message stanza may have be modified by triggers @@ -1354,7 +1354,7 @@ class SatMessageProtocol(xmppim.MessageProtocol): post_treat = defer.Deferred() d = self.host.trigger.async_point( - "messageReceived", client, message_elt, post_treat + "message_received", client, message_elt, post_treat ) d.addCallback(self._on_message_start_workflow, client, message_elt, post_treat) diff --git a/sat/memory/encryption.py b/sat/memory/encryption.py index 4f229b36..ad274a34 100644 --- a/sat/memory/encryption.py +++ b/sat/memory/encryption.py @@ -462,7 +462,7 @@ class EncryptionHandler: def mark_as_encrypted(self, mess_data, namespace): """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 message_received trigger of the plugin @param mess_data(dict): message data as used in post treat workflow @param namespace(str): namespace of the algorithm used for encrypting the message @@ -516,7 +516,7 @@ class EncryptionHandler: def mark_as_trusted(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 message_received trigger of the plugin @param mess_data(dict): message data as used in post treat workflow """ @@ -526,7 +526,7 @@ class EncryptionHandler: def mark_as_untrusted(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 message_received trigger of the plugin @param mess_data(dict): message data as used in post treat workflow """ diff --git a/sat/plugins/plugin_comp_ap_gateway/__init__.py b/sat/plugins/plugin_comp_ap_gateway/__init__.py index a0c49a1a..4aae33f4 100644 --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py @@ -162,7 +162,7 @@ class APGateway: self.pubsub_service = APPubsubService(self) self.ad_hoc = APAdHocService(self) self.ap_events = APEvents(self) - host.trigger.add("messageReceived", self._message_received_trigger, priority=-1000) + host.trigger.add("message_received", self._message_received_trigger, priority=-1000) host.trigger.add("XEP-0424_retractReceived", self._on_message_retract) host.trigger.add("XEP-0372_ref_received", self._on_reference_received) diff --git a/sat/plugins/plugin_exp_command_export.py b/sat/plugins/plugin_exp_command_export.py index a4852fb5..2f480e83 100644 --- a/sat/plugins/plugin_exp_command_export.py +++ b/sat/plugins/plugin_exp_command_export.py @@ -92,7 +92,7 @@ class CommandExport(object): log.info(_("Plugin command export initialization")) self.host = host self.spawned = {} # key = entity - host.trigger.add("messageReceived", self.message_received_trigger, priority=10000) + host.trigger.add("message_received", self.message_received_trigger, priority=10000) host.bridge.add_method( "command_export", ".plugin", @@ -148,7 +148,7 @@ class CommandExport(object): - exclusive: if set, skip all other triggers - loop: if set, restart the command once terminated #TODO - pty: if set, launch in a pseudo terminal - - continue: continue normal messageReceived handling + - continue: continue normal message_received handling """ client = self.host.get_client(profile_key) for target in targets: diff --git a/sat/plugins/plugin_exp_lang_detect.py b/sat/plugins/plugin_exp_lang_detect.py index 6f5cc429..6bc244ba 100644 --- a/sat/plugins/plugin_exp_lang_detect.py +++ b/sat/plugins/plugin_exp_lang_detect.py @@ -66,7 +66,7 @@ class LangDetect(object): log.info(_("Language detection plugin initialization")) self.host = host host.memory.update_params(PARAMS) - host.trigger.add("messageReceived", self.message_received_trigger) + host.trigger.add("message_received", self.message_received_trigger) host.trigger.add("sendMessage", self.message_send_trigger) def add_language(self, mess_data): diff --git a/sat/plugins/plugin_exp_parrot.py b/sat/plugins/plugin_exp_parrot.py index cf423069..4d7387ba 100644 --- a/sat/plugins/plugin_exp_parrot.py +++ b/sat/plugins/plugin_exp_parrot.py @@ -55,7 +55,7 @@ class Exp_Parrot(object): def __init__(self, host): log.info(_("Plugin Parrot initialization")) self.host = host - host.trigger.add("messageReceived", self.message_received_trigger, priority=100) + host.trigger.add("message_received", self.message_received_trigger, priority=100) # host.trigger.add("sendMessage", self.send_message_trigger, priority=100) try: self.host.plugins[C.TEXT_CMDS].register_text_commands(self) diff --git a/sat/plugins/plugin_misc_android.py b/sat/plugins/plugin_misc_android.py index a6ba9b8d..8f8137cc 100644 --- a/sat/plugins/plugin_misc_android.py +++ b/sat/plugins/plugin_misc_android.py @@ -268,7 +268,7 @@ class AndroidPlugin(object): raise e # we set a low priority because we want the notification to be sent after all # plugins have done their job - host.trigger.add("messageReceived", self.message_received_trigger, priority=-1000) + host.trigger.add("message_received", self.message_received_trigger, priority=-1000) # profiles autoconnection host.bridge.add_method( diff --git a/sat/plugins/plugin_sec_aesgcm.py b/sat/plugins/plugin_sec_aesgcm.py index d0d01d7e..f8172490 100644 --- a/sat/plugins/plugin_sec_aesgcm.py +++ b/sat/plugins/plugin_sec_aesgcm.py @@ -70,7 +70,7 @@ class AESGCM(object): self.can_handle_attachment, self.attach, encrypted=True) host.trigger.add("XEP-0363_upload_pre_slot", self._upload_pre_slot) host.trigger.add("XEP-0363_upload", self._upload_trigger) - host.trigger.add("messageReceived", self._message_received_trigger) + host.trigger.add("message_received", self._message_received_trigger) async def download(self, client, uri_parsed, dest_path, options): fragment = bytes.fromhex(uri_parsed.fragment) diff --git a/sat/plugins/plugin_sec_otr.py b/sat/plugins/plugin_sec_otr.py index b97d008e..e8393d9e 100644 --- a/sat/plugins/plugin_sec_otr.py +++ b/sat/plugins/plugin_sec_otr.py @@ -314,7 +314,7 @@ class OTR(object): ) #  FIXME: OTR should not be skipped per profile, this need to be refactored self._p_hints = host.plugins["XEP-0334"] self._p_carbons = host.plugins["XEP-0280"] - host.trigger.add("messageReceived", self.message_received_trigger, priority=100000) + host.trigger.add("message_received", self.message_received_trigger, priority=100000) host.trigger.add("sendMessage", self.send_message_trigger, priority=100000) host.trigger.add("send_message_data", self._send_message_data_trigger) host.bridge.add_method( diff --git a/sat/plugins/plugin_sec_oxps.py b/sat/plugins/plugin_sec_oxps.py index 482736bd..a3b47a4e 100644 --- a/sat/plugins/plugin_sec_oxps.py +++ b/sat/plugins/plugin_sec_oxps.py @@ -91,7 +91,7 @@ class PubsubEncryption: host.trigger.add("XEP-0060_publish", self._publish_trigger) host.trigger.add("XEP-0060_items", self._items_trigger) host.trigger.add( - "messageReceived", + "message_received", self._message_received_trigger, ) host.bridge.add_method( diff --git a/sat/plugins/plugin_xep_0033.py b/sat/plugins/plugin_xep_0033.py index e8b66cf8..426a6b8c 100644 --- a/sat/plugins/plugin_xep_0033.py +++ b/sat/plugins/plugin_xep_0033.py @@ -79,7 +79,7 @@ class XEP_0033(object): host.trigger.add( "sendMessage", self.send_message_trigger, trigger.TriggerManager.MIN_PRIORITY ) - host.trigger.add("messageReceived", self.message_received_trigger) + host.trigger.add("message_received", self.message_received_trigger) def send_message_trigger( self, client, mess_data, pre_xml_treatments, post_xml_treatments diff --git a/sat/plugins/plugin_xep_0045.py b/sat/plugins/plugin_xep_0045.py index a426121e..3406cae1 100644 --- a/sat/plugins/plugin_xep_0045.py +++ b/sat/plugins/plugin_xep_0045.py @@ -155,7 +155,7 @@ class XEP_0045(object): host.trigger.add("presence_available", self.presence_trigger) host.trigger.add("presence_received", self.presence_received_trigger) - host.trigger.add("messageReceived", self.message_received_trigger, priority=1000000) + host.trigger.add("message_received", self.message_received_trigger, priority=1000000) host.trigger.add("message_parse", self._message_parse_trigger) async def profile_connected(self, client): diff --git a/sat/plugins/plugin_xep_0071.py b/sat/plugins/plugin_xep_0071.py index fdcb58e0..4fca4618 100644 --- a/sat/plugins/plugin_xep_0071.py +++ b/sat/plugins/plugin_xep_0071.py @@ -100,7 +100,7 @@ class XEP_0071(object): self.XHTML2XHTML_IM, [self._s.OPT_HIDDEN], ) - host.trigger.add("messageReceived", self.message_received_trigger) + host.trigger.add("message_received", self.message_received_trigger) host.trigger.add("sendMessage", self.send_message_trigger) def get_handler(self, client): @@ -109,7 +109,7 @@ class XEP_0071(object): def _message_post_treat(self, data, message_elt, body_elts, client): """Callback which manage the post treatment of the message in case of XHTML-IM found - @param data: data send by messageReceived trigger through post_treat deferred + @param data: data send by message_received trigger through post_treat deferred @param message_elt: whole stanza @param body_elts: XHTML-IM body elements found @return: the data with the extra parameter updated diff --git a/sat/plugins/plugin_xep_0085.py b/sat/plugins/plugin_xep_0085.py index ed772dbd..141f40eb 100644 --- a/sat/plugins/plugin_xep_0085.py +++ b/sat/plugins/plugin_xep_0085.py @@ -106,7 +106,7 @@ class XEP_0085(object): host.memory.update_params(self.params) # triggers from core - host.trigger.add("messageReceived", self.message_received_trigger) + host.trigger.add("message_received", self.message_received_trigger) host.trigger.add("sendMessage", self.send_message_trigger) host.trigger.add("param_update_trigger", self.param_update_trigger) diff --git a/sat/plugins/plugin_xep_0249.py b/sat/plugins/plugin_xep_0249.py index 48f0f7b0..e3032652 100644 --- a/sat/plugins/plugin_xep_0249.py +++ b/sat/plugins/plugin_xep_0249.py @@ -95,7 +95,7 @@ class XEP_0249(object): except KeyError: log.info(_("Text commands not available")) host.register_namespace('x-conference', NS_X_CONFERENCE) - host.trigger.add("messageReceived", self._message_received_trigger) + host.trigger.add("message_received", self._message_received_trigger) def get_handler(self, client): return XEP_0249_handler() diff --git a/sat/plugins/plugin_xep_0280.py b/sat/plugins/plugin_xep_0280.py index 34e398cc..339b7acb 100644 --- a/sat/plugins/plugin_xep_0280.py +++ b/sat/plugins/plugin_xep_0280.py @@ -75,7 +75,7 @@ class XEP_0280(object): log.info(_("Plugin XEP_0280 initialization")) self.host = host host.memory.update_params(self.params) - host.trigger.add("messageReceived", self.message_received_trigger, priority=200000) + host.trigger.add("message_received", self.message_received_trigger, priority=200000) def get_handler(self, client): return XEP_0280_handler() diff --git a/sat/plugins/plugin_xep_0320.py b/sat/plugins/plugin_xep_0320.py index 3f0b8807..a05ca551 100644 --- a/sat/plugins/plugin_xep_0320.py +++ b/sat/plugins/plugin_xep_0320.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 - # Libervia plugin # Copyright (C) 2009-2023 Jérôme Poisson (goffi@goffi.org) diff --git a/sat/plugins/plugin_xep_0334.py b/sat/plugins/plugin_xep_0334.py index 1633c0e9..e7c4200f 100644 --- a/sat/plugins/plugin_xep_0334.py +++ b/sat/plugins/plugin_xep_0334.py @@ -68,7 +68,7 @@ class XEP_0334(object): log.info(_("Message Processing Hints plugin initialization")) self.host = host host.trigger.add("sendMessage", self.send_message_trigger) - host.trigger.add("messageReceived", self.message_received_trigger, priority=-1000) + host.trigger.add("message_received", self.message_received_trigger, priority=-1000) def get_handler(self, client): return XEP_0334_handler() diff --git a/sat/plugins/plugin_xep_0353.py b/sat/plugins/plugin_xep_0353.py index fde4629e..ecf8c2a7 100644 --- a/sat/plugins/plugin_xep_0353.py +++ b/sat/plugins/plugin_xep_0353.py @@ -55,7 +55,7 @@ class XEP_0353: host.register_namespace("jingle-message", NS_JINGLE_MESSAGE) self._j = host.plugins["XEP-0166"] host.trigger.add("XEP-0166_initiate", self._on_initiate_trigger) - host.trigger.add("messageReceived", self._on_message_received) + host.trigger.add("message_received", self._on_message_received) def get_handler(self, client): return Handler() diff --git a/sat/plugins/plugin_xep_0372.py b/sat/plugins/plugin_xep_0372.py index d583c96f..652e19f3 100644 --- a/sat/plugins/plugin_xep_0372.py +++ b/sat/plugins/plugin_xep_0372.py @@ -65,7 +65,7 @@ class XEP_0372: host.register_namespace("refs", NS_REFS) self.host = host self._h = host.plugins["XEP-0334"] - host.trigger.add("messageReceived", self._message_received_trigger) + host.trigger.add("message_received", self._message_received_trigger) host.bridge.add_method( "reference_send", ".plugin", diff --git a/sat/plugins/plugin_xep_0374.py b/sat/plugins/plugin_xep_0374.py index 6314f84f..2511257a 100644 --- a/sat/plugins/plugin_xep_0374.py +++ b/sat/plugins/plugin_xep_0374.py @@ -85,7 +85,7 @@ class XEP_0374: # Triggers sat.trigger.add( - "messageReceived", + "message_received", self.__message_received_trigger, priority=100050 ) diff --git a/sat/plugins/plugin_xep_0380.py b/sat/plugins/plugin_xep_0380.py index 40af15bf..4f237818 100644 --- a/sat/plugins/plugin_xep_0380.py +++ b/sat/plugins/plugin_xep_0380.py @@ -48,7 +48,7 @@ class XEP_0380(object): def __init__(self, host): self.host = host host.trigger.add("sendMessage", self._send_message_trigger) - host.trigger.add("messageReceived", self._message_received_trigger, priority=100) + host.trigger.add("message_received", self._message_received_trigger, priority=100) host.register_namespace("eme", NS_EME) def _add_eme_element(self, mess_data, namespace, name): diff --git a/sat/plugins/plugin_xep_0384.py b/sat/plugins/plugin_xep_0384.py index 8ce80e7a..80733bdb 100644 --- a/sat/plugins/plugin_xep_0384.py +++ b/sat/plugins/plugin_xep_0384.py @@ -1578,9 +1578,9 @@ class OMEMO: # These triggers are used by oldmemo, which doesn't do SCE and only applies to # messages. Temporarily, until a more fitting trigger for SCE-based encryption is - # added, the messageReceived trigger is also used for twomemo. + # added, the message_received trigger is also used for twomemo. sat.trigger.add( - "messageReceived", + "message_received", self._message_received_trigger, priority=100050 ) diff --git a/sat/plugins/plugin_xep_0424.py b/sat/plugins/plugin_xep_0424.py index d66d7c9b..8b2c463c 100644 --- a/sat/plugins/plugin_xep_0424.py +++ b/sat/plugins/plugin_xep_0424.py @@ -74,7 +74,7 @@ class XEP_0424(object): self._h = host.plugins["XEP-0334"] self._f = host.plugins["XEP-0422"] host.register_namespace("message-retract", NS_MESSAGE_RETRACT) - host.trigger.add("messageReceived", self._message_received_trigger, 100) + host.trigger.add("message_received", self._message_received_trigger, 100) host.bridge.add_method( "message_retract", ".plugin", diff --git a/sat/plugins/plugin_xep_0444.py b/sat/plugins/plugin_xep_0444.py index 522a1e35..40d9fee1 100644 --- a/sat/plugins/plugin_xep_0444.py +++ b/sat/plugins/plugin_xep_0444.py @@ -64,7 +64,7 @@ class XEP_0444: method=self._reactions_set, async_=True, ) - host.trigger.add("messageReceived", self._message_received_trigger) + host.trigger.add("message_received", self._message_received_trigger) def get_handler(self, client): return XEP_0444_Handler() diff --git a/sat/plugins/plugin_xep_0447.py b/sat/plugins/plugin_xep_0447.py index 0e05c278..81440110 100644 --- a/sat/plugins/plugin_xep_0447.py +++ b/sat/plugins/plugin_xep_0447.py @@ -73,7 +73,7 @@ class XEP_0447: self._u.namespace, "url-data", self._u.parse_url_data_elt ) host.plugins["DOWNLOAD"].register_download_handler(self._u.namespace, self.download) - host.trigger.add("messageReceived", self._message_received_trigger) + host.trigger.add("message_received", self._message_received_trigger) def register_source_handler( self, namespace: str, element_name: str,