Software /
code /
prosody
Changeset
6012:7e8a624272bf
mod_ping: Use type-specific event
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Feb 2014 15:09:12 +0100 |
parents | 6010:fad7084a0b35 |
children | 6013:918ab89cb68d |
files | plugins/mod_ping.lua |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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