aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-02-09 15:09:12 +0100
committerKim Alvefur <zash@zash.se>2014-02-09 15:09:12 +0100
commitbe627072d76e66b5ea48ac98080676115e2058f3 (patch)
treeea912470711f828763246e9da24a760ea83416aa
parentcf20170bb3481dcdd673d14248937eae0d47a3bd (diff)
downloadprosody-be627072d76e66b5ea48ac98080676115e2058f3.tar.gz
prosody-be627072d76e66b5ea48ac98080676115e2058f3.zip
mod_ping: Use type-specific event
-rw-r--r--plugins/mod_ping.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/mod_ping.lua b/plugins/mod_ping.lua
index eddb92d2..1a503409 100644
--- a/plugins/mod_ping.lua
+++ b/plugins/mod_ping.lua
@@ -11,14 +11,11 @@ local st = require "util.stanza";
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