From a5729b8b5642d644e1e0089d75e4815abed1e556 Mon Sep 17 00:00:00 2001 From: nicoco Date: Fri, 14 Apr 2023 05:39:46 +0200 Subject: [PATCH] core: fix adding bogus bookmark Discovered via https://github.com/tigase/beagle-im/issues/133 Fixes: https://todo.sr.ht/~nicoco/slidge/157 --- slidge/core/muc/room.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/slidge/core/muc/room.py b/slidge/core/muc/room.py index 942759cc..42624a2f 100644 --- a/slidge/core/muc/room.py +++ b/slidge/core/muc/room.py @@ -781,11 +781,6 @@ async def add_to_bookmarks(self, auto_join=True, invite=False, preserve=True): """ item = Item() item["id"] = self.jid - 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 @@ -799,6 +794,7 @@ async def add_to_bookmarks(self, auto_join=True, invite=False, preserve=True): # this below creates the item if it wasn't here already # (slixmpp annoying magic) item = ans["pubsub"]["items"]["item"] + item["id"] = self.jid except IqError: item["conference"]["name"] = self.name item["conference"]["autojoin"] = auto_join