plugin XEP-0048: Don't use legacy bookmarks anymore on profile connection:

Legacy bookmarks are not used anymore for autoconnect, it will be done from XEP-0402 now.
This commit is contained in:
Goffi 2026-05-03 11:58:58 +02:00
commit 2d86208e98

View file

@ -107,6 +107,8 @@ class XEP_0048(object):
log.info(_("Text commands not available"))
async def profile_connected(self, client):
# FIXME: We should probably get fully rid of local bookmarks, and probably this
# whole plugin now that there is XEP-0402
local = client.bookmarks_local = PersistentBinaryDict(
NS_BOOKMARKS, client.profile
)
@ -114,20 +116,6 @@ class XEP_0048(object):
local = cast(dict[str, dict | None] | None, local)
if not local:
local = {XEP_0048.MUC_TYPE: {}, XEP_0048.URL_TYPE: {}}
private = await self._get_server_bookmarks("private", client.profile)
pubsub = client.bookmarks_pubsub = None
for bookmarks in (local, private, pubsub):
if bookmarks is not None:
for room_jid, data in list(bookmarks[XEP_0048.MUC_TYPE].items()):
if data.get("autojoin", "false") == "true":
nick = data.get("nick", client.jid.user)
defer.ensureDeferred(
self.host.plugins["XEP-0045"].join(client, room_jid, nick, {})
)
# we don't use a DeferredList to gather result here, as waiting for all room would
# slow down a lot the connection process, and result in a bad user experience.
@defer.inlineCallbacks
def _get_server_bookmarks(self, storage_type, profile):