From 53e9bcf91d9376517487586f74ceb15352cce803 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 6 Oct 2026 22:56:23 +0200 Subject: [PATCH] plugin XEP-0272: remove the room bookmark when the group call ends: When joining a room, it may be automatically added to bookmark (e.g. by other clients), so we delete it when call end to be sure that we don't keep temporary rooms in bookmarks. --- libervia/backend/plugins/plugin_xep_0272.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_xep_0272.py b/libervia/backend/plugins/plugin_xep_0272.py index fc8e8e70..0a7d5f8c 100644 --- a/libervia/backend/plugins/plugin_xep_0272.py +++ b/libervia/backend/plugins/plugin_xep_0272.py @@ -32,6 +32,7 @@ from libervia.backend.core.log import getLogger from libervia.backend.plugins.plugin_xep_0045 import XEP_0045 from libervia.backend.plugins.plugin_xep_0166 import XEP_0166 from libervia.backend.plugins.plugin_xep_0167 import XEP_0167, mapping +from libervia.backend.plugins.plugin_xep_0402 import XEP_0402 from libervia.backend.plugins.plugin_xep_0482 import XEP_0482 from libervia.backend.tools import xml_tools from libervia.backend.tools.common import data_format @@ -44,7 +45,7 @@ PLUGIN_INFO = { C.PI_IMPORT_NAME: "XEP-0272", C.PI_TYPE: "XEP", C.PI_PROTOCOLS: ["XEP-0272"], - C.PI_DEPENDENCIES: ["XEP-0045", "XEP-0166", "XEP-0167", "XEP-0482"], + C.PI_DEPENDENCIES: ["XEP-0045", "XEP-0166", "XEP-0167", "XEP-0402", "XEP-0482"], C.PI_MAIN: "XEP_0272", C.PI_HANDLER: "yes", C.PI_DESCRIPTION: _( @@ -66,6 +67,7 @@ class XEP_0272: self._muc = cast(XEP_0045, host.plugins["XEP-0045"]) self._j = cast(XEP_0166, host.plugins["XEP-0166"]) self._rtp = cast(XEP_0167, host.plugins["XEP-0167"]) + self._bookmarks = cast(XEP_0402, host.plugins["XEP-0402"]) self._call_invites = cast(XEP_0482, host.plugins["XEP-0482"]) host.trigger.add("XEP-0166_initiate_elt_built", self._on_jingle_elt_built) host.trigger.add("XEP-0166_on_session_initiate", self._on_session_initiate) @@ -146,6 +148,12 @@ class XEP_0272: muji_data = self.get_muji_data(room) muji_data.clear() muji_data["to_call"] = set() + # remove the room bookmark (if any, e.g. created by another client) to avoid + # auto-joining the room at next login + try: + await self._bookmarks.remove(client, room_jid) + except Exception: + log.exception(f"Can't remove the bookmark of {room_jid}") def on_muji_request( self, presence_elt: domish.Element, client: SatXMPPEntity