# HG changeset patch # User Kim Alvefur # Date 1391954952 -3600 # Node ID 7e8a624272bfb2ec69712b2239a7862018ce481c # Parent fad7084a0b354b6b28eb606dd4bb7255253ad7b0 mod_ping: Use type-specific event diff -r fad7084a0b35 -r 7e8a624272bf plugins/mod_ping.lua --- a/plugins/mod_ping.lua Thu Feb 06 10:48:41 2014 +0100 +++ b/plugins/mod_ping.lua Sun Feb 09 15:09:12 2014 +0100 @@ -11,14 +11,11 @@ module:add_feature("urn:xmpp:ping"); local function ping_handler(event) - if event.stanza.attr.type == "get" then - event.origin.send(st.reply(event.stanza)); - return true; - end + return event.origin.send(st.reply(event.stanza)); end -module:hook("iq/bare/urn:xmpp:ping:ping", ping_handler); -module:hook("iq/host/urn:xmpp:ping:ping", ping_handler); +module:hook("iq-get/bare/urn:xmpp:ping:ping", ping_handler); +module:hook("iq-get/host/urn:xmpp:ping:ping", ping_handler); -- Ad-hoc command