Commit d62a2170 authored by Maxime Buquet's avatar Maxime Buquet

bookmarks: Convert specified jid to JID object if possible

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <>
parent 01bca5cc
......@@ -41,13 +41,20 @@ log = logging.getLogger(__name__)
class Bookmark:
def __init__(self,
jid: JID,
jid: Union[JID, str],
name: Optional[str] = None,
nick: Optional[str] = None,
password: Optional[str] = None,
method='local') -> None:
self.jid = jid
if isinstance(jid, JID):
self.jid = jid
self.jid = JID(jid)
except InvalidJID:
log.debug('Invalid JID %r provided for bookmark %r', jid, name)
raise = name or jid
self.autojoin = autojoin
self.nick = nick
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment