mod_version: Simplify iq handling by hooking on iq-get/ instead of iq/.
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Fri, 24 Aug 2018 20:35:33 +0200
changeset 9230 c0e058633d9a
parent 9229 affd84be3fc3
child 9231 e2e2aa76ea31
mod_version: Simplify iq handling by hooking on iq-get/ instead of iq/.
plugins/mod_version.lua
--- a/plugins/mod_version.lua	Fri Aug 24 20:35:17 2018 +0200
+++ b/plugins/mod_version.lua	Fri Aug 24 20:35:33 2018 +0200
@@ -39,9 +39,9 @@
 	end
 end
 
-module:hook("iq/host/jabber:iq:version:query", function(event)
+module:hook("iq-get/host/jabber:iq:version:query", function(event)
 	local stanza = event.stanza;
-	if stanza.attr.type == "get" and stanza.attr.to == module.host then
+	if stanza.attr.to == module.host then
 		event.origin.send(st.reply(stanza):add_child(query));
 		return true;
 	end