git » sdk » commit 68317f0

Some workarounds for disco issues

author Stephen Paul Weber
2025-06-25 19:03:33 UTC
committer Stephen Paul Weber
2025-06-25 19:03:33 UTC
parent 581a333841a1f6a1e232eb818ebabbd229ac7c38

Some workarounds for disco issues

Gajim says it has jig so we can't trust that, blah.

Also Sqlite backend doesn't store null presence right, cheogram.com
sends it, but then doesn't reply when sent to empty string resource.

snikket/Client.hx +3 -2

diff --git a/snikket/Client.hx b/snikket/Client.hx
index b0e4fe4..98d6ed7 100644
--- a/snikket/Client.hx
+++ b/snikket/Client.hx
@@ -847,15 +847,16 @@ class Client extends EventEmitter {
 				for (resource in Caps.withIdentity(chat.getCaps(), "gateway", null)) {
 					resources[resource] = true;
 				}
+				/* Gajim advertises this, so just go with identity instead
 				for (resource in Caps.withFeature(chat.getCaps(), "jabber:iq:gateway")) {
 					resources[resource] = true;
-				}
+				}*/
 				if (!sendAvailable && JID.parse(chat.chatId).isDomain()) {
 					resources[null] = true;
 				}
 				for (resource in resources.keys()) {
 					final bareJid = JID.parse(chat.chatId);
-					final fullJid = new JID(bareJid.node, bareJid.domain, resource);
+					final fullJid = new JID(bareJid.node, bareJid.domain, bareJid.isDomain() && resource == "" ? null : resource);
 					final jigGet = new JabberIqGatewayGet(fullJid.asString(), query);
 					jigGet.onFinished(() -> {
 						if (jigGet.getResult() == null) {