From cf8c7477bf6aafe21cafa71ed85ed70e0b07c079 Mon Sep 17 00:00:00 2001 From: nicoco Date: Thu, 13 Apr 2023 23:54:15 +0200 Subject: [PATCH] core: do not add bookmarks where JID has no local part Not sure when this happens, but apparently it can? References: https://github.com/tigase/beagle-im/issues/133 --- slidge/core/muc/room.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slidge/core/muc/room.py b/slidge/core/muc/room.py index 0dc4e04d..ebb8e24e 100644 --- a/slidge/core/muc/room.py +++ b/slidge/core/muc/room.py @@ -781,7 +781,11 @@ async def add_to_bookmarks(self, auto_join=True, invite=False, preserve=True): """ item = Item() item["id"] = self.jid - # item["id"] = "OCOCOCO" + if self.jid.local == "": + self.log.error( + "Tried to add a bookmark without a local part", exc_info=True + ) + return iq = Iq(stype="get", sfrom=self.user.jid, sto=self.user.jid) iq["pubsub"]["items"]["node"] = self.xmpp["xep_0402"].stanza.NS