Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_comp_file_sharing.py @ 4183:6784d07b99c8
plugin XEP-053, component AP gateway: use the new `trigger.add_with_check` method
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 09 Dec 2023 19:20:13 +0100 |
parents | 0f6fd28fde0d |
children | 0d7bb4df2343 |
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_comp_file_sharing.py Sat Dec 09 19:19:26 2023 +0100 +++ b/libervia/backend/plugins/plugin_comp_file_sharing.py Sat Dec 09 19:20:13 2023 +0100 @@ -356,18 +356,20 @@ self._t = self.host.plugins["XEP-0264"] self._hu = self.host.plugins["XEP-0363"] self._hu.register_handler(self._on_http_upload) - self.host.trigger.add("FILE_getDestDir", self._get_dest_dir_trigger) - self.host.trigger.add( - "XEP-0234_fileSendingRequest", self._file_sending_request_trigger, priority=1000 + self.host.trigger.add_with_check("FILE_getDestDir", self, self._get_dest_dir_trigger) + self.host.trigger.add_with_check( + "XEP-0234_fileSendingRequest", self, self._file_sending_request_trigger, priority=1000 ) - self.host.trigger.add("XEP-0234_buildFileElement", self._add_file_metadata_elts) - self.host.trigger.add("XEP-0234_parseFileElement", self._get_file_metadata_elts) - self.host.trigger.add("XEP-0329_compGetFilesFromNode", self._add_file_metadata) - self.host.trigger.add( + self.host.trigger.add_with_check("XEP-0234_buildFileElement", self, self._add_file_metadata_elts) + self.host.trigger.add_with_check("XEP-0234_parseFileElement", self, self._get_file_metadata_elts) + self.host.trigger.add_with_check("XEP-0329_compGetFilesFromNode", self, self._add_file_metadata) + self.host.trigger.add_with_check( "XEP-0329_compGetFilesFromNode_build_directory", + self, self._add_directory_metadata_elts) - self.host.trigger.add( + self.host.trigger.add_with_check( "XEP-0329_parseResult_directory", + self, self._get_directory_metadata_elts) self.files_path = self.host.get_local_path(None, C.FILES_DIR) self.http_port = int(self.host.memory.config_get(