summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2021-11-15 11:31:54 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2021-11-15 11:31:54 +0100
commit8947caae2e813627b446fbb0ffff2e2e356ca507 (patch)
tree953050d31871ec2933921b02e2575fd3740264aa
parent7f1e9b080c33272004374ac760aa2f346f9a22e9 (diff)
downloadpoezio-8947caae2e813627b446fbb0ffff2e2e356ca507.tar.gz
poezio-8947caae2e813627b446fbb0ffff2e2e356ca507.tar.bz2
poezio-8947caae2e813627b446fbb0ffff2e2e356ca507.tar.xz
poezio-8947caae2e813627b446fbb0ffff2e2e356ca507.zip
Add xmpp: URI support to the /join command
-rw-r--r--poezio/core/commands.py3
1 files changed, 3 insertions, 0 deletions
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