diff sat/plugins/plugin_xep_0234.py @ 3404:26a0af6e32c1

plugin XEP-0166: new trigger point + coroutines + helper methods: - a new `XEP-0166_initiate` async trigger point is available - `initate` is now a coroutine - `jingleSessionInit` in applications and transports handlers are now called using `utils.adDeferred` - new `getApplication` helper method, to retrieve application from its namespace - new `getContentData` helper method to retrieve application and its argument from content
author Goffi <goffi@goffi.org>
date Thu, 12 Nov 2020 14:53:15 +0100
parents 404d4b29de52
children c84c54c6b046
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0234.py	Thu Nov 12 14:53:15 2020 +0100
+++ b/sat/plugins/plugin_xep_0234.py	Thu Nov 12 14:53:15 2020 +0100
@@ -405,6 +405,11 @@
 
     # jingle callbacks
 
+    def jingleDescriptionElt(
+        self, client, session, content_name, filepath, name, extra, progress_id_d
+    ):
+        return domish.Element((NS_JINGLE_FT, "description"))
+
     def jingleSessionInit(
         self, client, session, content_name, filepath, name, extra, progress_id_d
     ):
@@ -423,7 +428,8 @@
         assert "file_path" not in application_data
         application_data["file_path"] = filepath
         file_data = application_data["file_data"] = {}
-        desc_elt = domish.Element((NS_JINGLE_FT, "description"))
+        desc_elt = self.jingleDescriptionElt(
+            client, session, content_name, filepath, name, extra, progress_id_d)
         file_elt = desc_elt.addElement("file")
 
         if content_data["senders"] == self._j.ROLE_INITIATOR: