changeset 4585:05c74210c007

mod_auto_answer_disco_info: Fix to use event that is fired There are no iq-type/full/xmlns:name events
author Kim Alvefur <zash@zash.se>
date Sat, 12 Jun 2021 14:47:06 +0200
parents f6f28ceff53a
children 240fa534f586
files mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua	Mon Jun 07 19:15:28 2021 +0200
+++ b/mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua	Sat Jun 12 14:47:06 2021 +0200
@@ -24,4 +24,11 @@
 	end
 end
 
-module:hook("iq-get/full/http://jabber.org/protocol/disco#info:query", disco_handler, 1);
+module:hook("iq/full", function(event)
+	local stanza = event.stanza;
+	if stanza.attr.type == "get" then
+		if stanza:get_child("query", "http://jabber.org/protocol/disco#info") then
+			return disco_handler(event);
+		end
+	end
+end, 1);