Diff

plugins/mod_disco.lua @ 13408:d7857ef7843a 0.12

mod_disco: Advertise disco#info and #items on bare JIDs to fix #1664 Having to add these in *there* places seems less than ideal. I would also think that advertising disco#info is a bit redundant, since it is a requirement for everything in XMPP and if it was missing you would get an error back.
author Kim Alvefur <zash@zash.se>
date Sun, 17 Dec 2023 18:55:14 +0100
parent 12388:50fcd3879482
child 13409:95d8875c90dc
line wrap: on
line diff
--- a/plugins/mod_disco.lua	Wed Aug 23 12:18:34 2023 +0200
+++ b/plugins/mod_disco.lua	Sun Dec 17 18:55:14 2023 +0100
@@ -172,6 +172,8 @@
 	if not stanza.attr.to or (expose_admins and is_admin) or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
 		if node and node ~= "" then
 			local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info', node=node});
+			reply:tag("feature", { var = "http://jabber.org/protocol/disco#info" }):up();
+			reply:tag("feature", { var = "http://jabber.org/protocol/disco#items" }):up();
 			if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
 			local node_event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false};
 			local ret = module:fire_event("account-disco-info-node", node_event);
@@ -192,6 +194,8 @@
 		else
 			reply:tag('identity', {category='account', type='registered'}):up();
 		end
+		reply:tag("feature", { var = "http://jabber.org/protocol/disco#info" }):up();
+		reply:tag("feature", { var = "http://jabber.org/protocol/disco#items" }):up();
 		module:fire_event("account-disco-info", { origin = origin, reply = reply });
 		origin.send(reply);
 		return true;