git » sdk » commit 666187d

Try to extract JID from URL the dumb was as a fallback

author Stephen Paul Weber
2025-11-06 04:49:37 UTC
committer Stephen Paul Weber
2025-11-06 04:49:37 UTC
parent b5377e39e3ffe6883845ee360218c5ebd292cda3

Try to extract JID from URL the dumb was as a fallback

Supporting both https://xmpp.link/#jid and
https://conversations.im/i/jid style URLs when we can't see any other
way to interpret this.

borogove/Client.hx +8 -0

diff --git a/borogove/Client.hx b/borogove/Client.hx
index bb9c56f..fc51eda 100644
--- a/borogove/Client.hx
+++ b/borogove/Client.hx
@@ -911,6 +911,14 @@ class Client extends EventEmitter {
 		} else if (StringTools.startsWith(query, "BEGIN:VCARD") && vcard_regex.match(query)) {
 			final parts = vcard_regex.matched(1).split("?");
 			JID.parse(StringTools.urlDecode(parts[0]));
+		} else if (StringTools.startsWith(query, "https://")) {
+			final hashParts = query.split("#");
+			if (hashParts.length > 1) {
+				JID.parse(StringTools.urlDecode(hashParts[1]));
+			} else {
+				final pathParts = hashParts[0].split("/");
+				JID.parse(StringTools.urlDecode(pathParts[pathParts.length - 1]));
+			}
 		} else {
 			JID.parse(query);
 		}