From 8947caae2e813627b446fbb0ffff2e2e356ca507 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 15 Nov 2021 11:31:54 +0100 Subject: Add xmpp: URI support to the /join command --- poezio/core/commands.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poezio/core/commands.py b/poezio/core/commands.py index f6794092..915f9d90 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -3,6 +3,7 @@ Global commands which are to be linked to the Core class """ import asyncio +from urllib.parse import unquote from xml.etree import ElementTree as ET from typing import List, Optional, Tuple import logging @@ -343,6 +344,8 @@ class CommandCore: def _parse_join_jid(self, jid_string: str) -> Tuple[Optional[str], Optional[str]]: # we try to join a server directly server_root = False + if jid_string.startswith('xmpp:') and jid_string.endswith('?join'): + jid_string = unquote(jid_string[5:-5]) try: if jid_string.startswith('@'): server_root = True -- cgit v1.2.3