annotate sat/plugins/plugin_xep_0166/models.py @ 4044:3900626bc100

plugin XEP-0166: refactoring, and various improvments: - add models for transport and applications handlers and linked data - split models into separate file - some type hints - some documentation comments - add actions to prepare confirmation, useful to do initial parsing of all contents - application arg/kwargs and some transport data can be initialised during Jingle `initiate` call, this is notably useful when a call is made with transport data (this is the call for A/V calls where codecs and ICE candidate can be specified when starting a call) - session data can be specified during Jingle `initiate` call - new `store_in_session` argument in `_parse_elements`, which can be used to avoid race-condition when a context element (<decription> or <transport>) is being parsed for an action while an other action happens (like `transport-info`) - don't sed `sid` in `transport_elt` during a `transport-info` action anymore in `build_action`: this is specific to Jingle File Transfer and has been moved there rel 419
author Goffi <goffi@goffi.org>
date Mon, 15 May 2023 16:23:11 +0200
parents
children 2ced30f6d5de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4044
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python3
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
2
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Libervia plugin for Jingle (XEP-0166)
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
5
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or modify
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # it under the terms of the GNU Affero General Public License as published by
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # the Free Software Foundation, either version 3 of the License, or
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # (at your option) any later version.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
10
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # GNU Affero General Public License for more details.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
15
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
18
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
19
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 import abc
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 from dataclasses import dataclass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 from typing import Awaitable, Callable, Union
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
23
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 from twisted.internet import defer
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 from twisted.words.xish import domish
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
26
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 from sat.core.core_types import SatXMPPEntity
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 from sat.core.i18n import _
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
29
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
30
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 class BaseApplicationHandler(abc.ABC):
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
32
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 def jingle_request_confirmation(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 client: SatXMPPEntity,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 action: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 session: dict,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 content_name: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 desc_elt: domish.Element,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 Callable[..., Union[bool, defer.Deferred]],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 Callable[..., Awaitable[bool]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
45 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 If present, it is called on when session must be accepted.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 If not present, a generic accept dialog will be used.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
48
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
49 @param session: Jingle Session
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
50 @param desc_elt: <description> element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 @return: True if the session is accepted.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 A Deferred can be returned.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
55
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
56 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 def jingle_session_init(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
58 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 client: SatXMPPEntity,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
60 session: dict,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
61 content_name: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 *args, **kwargs
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 Callable[..., domish.Element],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 Callable[..., Awaitable[domish.Element]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
66 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
67 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 Must return the domish.Element used for initial content.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
69
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 @param client: SatXMPPEntity instance
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
71 @param session: Jingle Session
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 @param content_name: Name of the content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
73 @return: The domish.Element used for initial content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
74 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
75 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
76
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
77 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
78 def jingle_handler(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
79 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
80 client: SatXMPPEntity,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 action: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 session: dict,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
83 content_name: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
84 transport_elt: domish.Element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
85 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
86 Callable[..., None],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
87 Callable[..., Awaitable[None]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
88 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
89 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
90 Called on several actions to negotiate the application or transport.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
91
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
92 @param client: SatXMPPEntity instance
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
93 @param action: Jingle action
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
94 @param session: Jingle Session
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
95 @param content_name: Name of the content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
96 @param transport_elt: Transport element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
97 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
98 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
99
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
100 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
101 def jingle_terminate(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
102 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
103 reason_elt: domish.Element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
104 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
105 Callable[..., None],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
106 Callable[..., Awaitable[None]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
107 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
108 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
109 Called on session terminate, with reason_elt.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
110 May be used to clean session.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
111
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
112 @param reason_elt: Reason element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
113 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
114 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
115
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
116
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
117 class BaseTransportHandler(abc.ABC):
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
118
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
119 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
120 def jingle_session_init(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
121 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
122 client: SatXMPPEntity,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
123 session: dict,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
124 content_name: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
125 *args, **kwargs
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
126 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
127 Callable[..., domish.Element],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
128 Callable[..., Awaitable[domish.Element]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
129 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
130 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
131 Must return the domish.Element used for initial content.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
132
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
133 @param client: SatXMPPEntity instance
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
134 @param session: Jingle Session
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
135 @param content_name: Name of the content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
136 @return: The domish.Element used for initial content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
137 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
138 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
139
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
140 @abc.abstractmethod
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
141 def jingle_handler(
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
142 self,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
143 client: SatXMPPEntity,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
144 action: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
145 session: dict,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
146 content_name: str,
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
147 transport_elt: domish.Element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
148 ) -> Union[
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
149 Callable[..., None],
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
150 Callable[..., Awaitable[None]]
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
151 ]:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
152 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
153 Called on several actions to negotiate the application or transport.
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
154
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
155 @param client: SatXMPPEntity instance
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
156 @param action: Jingle action
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
157 @param session: Jingle Session
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
158 @param content_name: Name of the content
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
159 @param transport_elt: Transport element
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
160 """
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
161 pass
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
162
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
163
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
164 @dataclass(frozen=True)
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
165 class ApplicationData:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
166 namespace: str
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
167 handler: BaseApplicationHandler
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
168
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
169
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
170 @dataclass(frozen=True)
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
171 class TransportData:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
172 namespace: str
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
173 handler: BaseTransportHandler
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
174 priority: int
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
175
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
176
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
177 @dataclass(frozen=True)
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
178 class ContentData:
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
179 application: ApplicationData
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
180 app_args: list
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
181 app_kwargs: dict
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
182 transport_data: dict
3900626bc100 plugin XEP-0166: refactoring, and various improvments:
Goffi <goffi@goffi.org>
parents:
diff changeset
183 content_name: str