Diff

mod_pinger/mod_pinger.lua @ 2671:80b6c63cb559

mod_pinger: Fix hardcoded smacks namespace, fixes #712
author tmolitor <thilo@eightysoft.de>
date Thu, 06 Apr 2017 02:31:16 +0200
parent 2034:256a5e3591db
child 2672:75ab061069aa
line wrap: on
line diff
--- 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);