plugin XEP-0298: remove the obsolete session-init trigger:
- Conferences are not using XEP-0298 anymore, following the Jingle A/V Conferences protoXEP update. - fix XEP-0166 dependency
This commit is contained in:
parent
cb570ab3cf
commit
53e6de5a3b
1 changed files with 1 additions and 26 deletions
|
|
@ -39,7 +39,7 @@ PLUGIN_INFO = {
|
||||||
C.PI_TYPE: "XEP",
|
C.PI_TYPE: "XEP",
|
||||||
C.PI_MODES: C.PLUG_MODE_BOTH,
|
C.PI_MODES: C.PLUG_MODE_BOTH,
|
||||||
C.PI_PROTOCOLS: [],
|
C.PI_PROTOCOLS: [],
|
||||||
C.PI_DEPENDENCIES: ["XEP-0167"],
|
C.PI_DEPENDENCIES: ["XEP-0166"],
|
||||||
C.PI_MAIN: "XEP_0298",
|
C.PI_MAIN: "XEP_0298",
|
||||||
C.PI_HANDLER: "yes",
|
C.PI_HANDLER: "yes",
|
||||||
C.PI_DESCRIPTION: _(
|
C.PI_DESCRIPTION: _(
|
||||||
|
|
@ -59,36 +59,11 @@ class XEP_0298:
|
||||||
log.info(f"plugin {PLUGIN_INFO[C.PI_NAME]!r} initialization")
|
log.info(f"plugin {PLUGIN_INFO[C.PI_NAME]!r} initialization")
|
||||||
self.host = host
|
self.host = host
|
||||||
self._j: XEP_0166 = host.plugins["XEP-0166"]
|
self._j: XEP_0166 = host.plugins["XEP-0166"]
|
||||||
host.trigger.add(
|
|
||||||
"XEP-0167_jingle_session_init", self._jingle_session_init_trigger
|
|
||||||
)
|
|
||||||
host.trigger.add("XEP-0167_jingle_handler", self._jingle_handler_trigger)
|
host.trigger.add("XEP-0167_jingle_handler", self._jingle_handler_trigger)
|
||||||
|
|
||||||
def get_handler(self, client):
|
def get_handler(self, client):
|
||||||
return CoinHandler(self)
|
return CoinHandler(self)
|
||||||
|
|
||||||
def _jingle_session_init_trigger(
|
|
||||||
self,
|
|
||||||
client: SatXMPPEntity,
|
|
||||||
session: dict,
|
|
||||||
content_name: str,
|
|
||||||
media: str,
|
|
||||||
media_data: dict,
|
|
||||||
desc_elt: domish.Element,
|
|
||||||
) -> None:
|
|
||||||
"""Check for the presence of "user" metadata, and add relevant elements."""
|
|
||||||
if client.profile == "conferences":
|
|
||||||
if content_name != next(iter(session["contents"].keys())):
|
|
||||||
# We only apply metadata for the first content, as it is global.
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
user = session["metadata"]["user"]
|
|
||||||
except KeyError:
|
|
||||||
return
|
|
||||||
jingle_elt = session["jingle_elt"]
|
|
||||||
conference_info_elt = self.add_conference_info(jingle_elt, True)
|
|
||||||
self.add_user(conference_info_elt, user)
|
|
||||||
|
|
||||||
async def _jingle_handler_trigger(
|
async def _jingle_handler_trigger(
|
||||||
self,
|
self,
|
||||||
client: SatXMPPEntity,
|
client: SatXMPPEntity,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue