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
This commit is contained in:
Goffi 2020-11-12 14:53:15 +01:00
commit aab9a8bf91

View file

@ -405,6 +405,11 @@ class XEP_0234:
# 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 @@ class XEP_0234:
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: