diff --git a/sat/plugins/plugin_comp_file_sharing_management.py b/sat/plugins/plugin_comp_file_sharing_management.py index 3bfc74b6..5c0e3562 100644 --- a/sat/plugins/plugin_comp_file_sharing_management.py +++ b/sat/plugins/plugin_comp_file_sharing_management.py @@ -73,6 +73,14 @@ class FileSharingManagement(object): self._c = host.plugins["XEP-0050"] self._t = host.plugins["XEP-0264"] self.files_path = host.getLocalPath(None, C.FILES_DIR, profile=False) + host.bridge.addMethod( + "fileSharingDelete", + ".plugin", + in_sign="ssss", + out_sign="", + method=self._delete, + async_=True, + ) def profileConnected(self, client): self._c.addAdHocCommand( @@ -91,6 +99,16 @@ class FileSharingManagement(object): allowed_magics=C.ENTITY_ALL, ) + def _delete(self, service_jid_s, path, namespace, profile): + client = self.host.getClient(profile) + service_jid = jid.JID(service_jid_s) if service_jid_s else None + return defer.ensureDeferred(self._c.sequence( + client, + [{"path": path, "namespace": namespace}, {"confirm": True}], + NS_FILE_MANAGEMENT_DELETE, + service_jid, + )) + def _err(self, reason): """Helper method to get argument to return for error