Software /
code /
prosody
Comparison
plugins/mod_ping.lua @ 8961:5d4ebceaf8aa
mod_ping: Depend on mod_ahoc
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 02 Jul 2018 23:41:47 +0200 |
parent | 8729:c519c778f2b2 |
child | 8963:ff522d5db95d |
comparison
equal
deleted
inserted
replaced
8960:9d0d1e427b82 | 8961:5d4ebceaf8aa |
---|---|
24 function ping_command_handler (self, data, state) -- luacheck: ignore 212 | 24 function ping_command_handler (self, data, state) -- luacheck: ignore 212 |
25 local now = datetime(); | 25 local now = datetime(); |
26 return { info = "Pong\n"..now, status = "completed" }; | 26 return { info = "Pong\n"..now, status = "completed" }; |
27 end | 27 end |
28 | 28 |
29 module:depend "adhoc"; | |
29 local adhoc_new = module:require "adhoc".new; | 30 local adhoc_new = module:require "adhoc".new; |
30 local descriptor = adhoc_new("Ping", "ping", ping_command_handler); | 31 local descriptor = adhoc_new("Ping", "ping", ping_command_handler); |
31 module:add_item ("adhoc", descriptor); | 32 module:add_item ("adhoc", descriptor); |
32 | 33 |