Diff

mod_query_client_ver/mod_query_client_ver.lua @ 2653:96eabf8591a6

mod_query_client_ver: Handle IQ errors (see #876)
author Kim Alvefur <zash@zash.se>
date Thu, 30 Mar 2017 21:12:14 +0200
parent 2652:20ebfa4ad7f4
child 2990:cb8d65b40fb4
line wrap: on
line diff
--- a/mod_query_client_ver/mod_query_client_ver.lua	Thu Mar 30 21:04:40 2017 +0200
+++ b/mod_query_client_ver/mod_query_client_ver.lua	Thu Mar 30 21:12:14 2017 +0200
@@ -30,9 +30,13 @@
 				client = client .. " version " .. version;
 			end
 			origin.log("info", "Running %s", client);
-			return true;
 		end
 	end
+	return true;
+end);
+
+module:hook("iq-error/host/"..version_id, function(event)
+	local origin, stanza = event.origin, event.stanza;
 	origin.send(st.iq({ id = disco_id, type = "get", from = module.host, to = origin.full_jid }):query(xmlns_disco_info));
 	return true;
 end);
@@ -46,7 +50,9 @@
 			origin.log("info", "Running %s", ident.attr.name);
 		end
 	end
-	-- Unknown software
 	return true;
 end);
 
+module:hook("iq-error/host/"..disco_id, function()
+	return true; -- Doesn't reply to disco#info? Weird, but ignore for now.
+end);