mod_pinger: Fix hardcoded smacks namespace, fixes #712

Thu, 06 Apr 2017 02:31:16 +0200

author
tmolitor <thilo@eightysoft.de>
date
Thu, 06 Apr 2017 02:31:16 +0200
changeset 2671
80b6c63cb559
parent 2670
6e01878103c0
child 2672
75ab061069aa

mod_pinger: Fix hardcoded smacks namespace, fixes #712

mod_pinger/mod_pinger.lua file | annotate | diff | comparison | revisions
--- a/mod_pinger/mod_pinger.lua	Thu Apr 06 02:12:14 2017 +0200
+++ b/mod_pinger/mod_pinger.lua	Thu Apr 06 02:31:16 2017 +0200
@@ -15,12 +15,12 @@
 	local session = watchdog.session;
 	if not session.idle_pinged then
 		session.idle_pinged = true;
-               if session.smacks and not session.awaiting_ack then
-                       session.send(st.stanza("r", { xmlns = "urn:xmpp:sm:2" })) -- TODO: hardcoded sm:2
-               else
-                       session.send(st.iq({ type = "get", from = module.host, id = "idle-check" })
-                               :tag("ping", { xmlns = "urn:xmpp:ping" }));
-               end
+		if session.smacks and not session.awaiting_ack then
+				session.send(st.stanza("r", { xmlns = session.smacks }))
+		else
+				session.send(st.iq({ type = "get", from = module.host, id = "idle-check" })
+						:tag("ping", { xmlns = "urn:xmpp:ping" }));
+		end
 		return ping_timeout; -- Call us again after ping_timeout
 	else
 		module:log("info", "Client %q silent for too long, closing...", session.full_jid);

mercurial