comparison 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
comparison
equal deleted inserted replaced
4182:4dc00e848961 4183:6784d07b99c8
354 self._jf = self.host.plugins["XEP-0234"] 354 self._jf = self.host.plugins["XEP-0234"]
355 self._h = self.host.plugins["XEP-0300"] 355 self._h = self.host.plugins["XEP-0300"]
356 self._t = self.host.plugins["XEP-0264"] 356 self._t = self.host.plugins["XEP-0264"]
357 self._hu = self.host.plugins["XEP-0363"] 357 self._hu = self.host.plugins["XEP-0363"]
358 self._hu.register_handler(self._on_http_upload) 358 self._hu.register_handler(self._on_http_upload)
359 self.host.trigger.add("FILE_getDestDir", self._get_dest_dir_trigger) 359 self.host.trigger.add_with_check("FILE_getDestDir", self, self._get_dest_dir_trigger)
360 self.host.trigger.add( 360 self.host.trigger.add_with_check(
361 "XEP-0234_fileSendingRequest", self._file_sending_request_trigger, priority=1000 361 "XEP-0234_fileSendingRequest", self, self._file_sending_request_trigger, priority=1000
362 ) 362 )
363 self.host.trigger.add("XEP-0234_buildFileElement", self._add_file_metadata_elts) 363 self.host.trigger.add_with_check("XEP-0234_buildFileElement", self, self._add_file_metadata_elts)
364 self.host.trigger.add("XEP-0234_parseFileElement", self._get_file_metadata_elts) 364 self.host.trigger.add_with_check("XEP-0234_parseFileElement", self, self._get_file_metadata_elts)
365 self.host.trigger.add("XEP-0329_compGetFilesFromNode", self._add_file_metadata) 365 self.host.trigger.add_with_check("XEP-0329_compGetFilesFromNode", self, self._add_file_metadata)
366 self.host.trigger.add( 366 self.host.trigger.add_with_check(
367 "XEP-0329_compGetFilesFromNode_build_directory", 367 "XEP-0329_compGetFilesFromNode_build_directory",
368 self,
368 self._add_directory_metadata_elts) 369 self._add_directory_metadata_elts)
369 self.host.trigger.add( 370 self.host.trigger.add_with_check(
370 "XEP-0329_parseResult_directory", 371 "XEP-0329_parseResult_directory",
372 self,
371 self._get_directory_metadata_elts) 373 self._get_directory_metadata_elts)
372 self.files_path = self.host.get_local_path(None, C.FILES_DIR) 374 self.files_path = self.host.get_local_path(None, C.FILES_DIR)
373 self.http_port = int(self.host.memory.config_get( 375 self.http_port = int(self.host.memory.config_get(
374 'component file-sharing', 'http_upload_port', 8888)) 376 'component file-sharing', 'http_upload_port', 8888))
375 connection_type = self.host.memory.config_get( 377 connection_type = self.host.memory.config_get(