diff libervia/backend/plugins/plugin_xep_0447.py @ 4335:430d5d99a740

plugin XEP-0358: "Publishing Available Jingle Sessions" implementation: rel 453
author Goffi <goffi@goffi.org>
date Tue, 03 Dec 2024 00:13:07 +0100
parents 111dce64dcb5
children
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0447.py	Tue Dec 03 00:12:38 2024 +0100
+++ b/libervia/backend/plugins/plugin_xep_0447.py	Tue Dec 03 00:13:07 2024 +0100
@@ -47,6 +47,7 @@
 from libervia.backend.core.i18n import _
 from libervia.backend.core.log import getLogger
 from libervia.backend.plugins.plugin_xep_0103 import URLData, XEP_0103
+from libervia.backend.plugins.plugin_xep_0358 import JinglePub, XEP_0358
 from libervia.backend.plugins.plugin_xep_0446 import FileMetadata, XEP_0446
 from libervia.backend.tools import stream
 from libervia.backend.tools.web import treq_client_no_ssl
@@ -63,6 +64,7 @@
     C.PI_DEPENDENCIES: [
         "XEP-0103",
         "XEP-0334",
+        "XEP-0358",
         "XEP-0446",
         "ATTACH",
         "DOWNLOAD",
@@ -186,6 +188,17 @@
         return super().to_element()
 
 
+class JinglePubSource(JinglePub, Source):
+    type = "jingle"
+
+    @classmethod
+    def from_element(cls, element: domish.Element) -> Self:
+        return super().from_element(element)
+
+    def to_element(self) -> domish.Element:
+        return super().to_element()
+
+
 class XEP_0447:
     namespace = NS_SFS
 
@@ -196,6 +209,7 @@
         FileSharing._sfs = self
         self._sources_handlers: dict[tuple[str, str], type[Source]] = {}
         self._u = cast(XEP_0103, host.plugins["XEP-0103"])
+        self._jp = cast(XEP_0358, host.plugins["XEP-0358"])
         self._hints = host.plugins["XEP-0334"]
         self._m = cast(XEP_0446, host.plugins["XEP-0446"])
         self._http_upload = host.plugins.get("XEP-0363")