Comparison

plugins/mod_ping.lua @ 10399:270cb2821566

mod_ping: Remove ad-hoc command 17:27:40 <Ge0rG> Zash: the Ping thing is absolutely worthless 17:27:55 <Zash> The command provided by mod_ping? 17:27:59 <pep.> To own server? 17:28:14 <Ge0rG> the Ping command in mod_admin_web, whatever it maps to 17:28:29 <Ge0rG> > Pong > 2019-11-07T16:28:16Z What am I supposed to do with that result? 17:28:29 <Zash> Yeah, mod_ping provides that 17:28:41 <Ge0rG> Is it a ping to my own server? Where's the RTT? 17:28:48 <Zash> Dunno if it's useful for more than verifying that the adhoc command system works 17:29:02 <Ge0rG> (it lags, but there is no indication of how much) 17:29:14 <Zash> It can't really test that itself 17:29:52 <Zash> Anyone opposed to deleting it? 17:30:42 <Zash> Half the module 17:42:47 <MattJ> Zash, I'm fine with removing it
author Kim Alvefur <zash@zash.se>
date Thu, 07 Nov 2019 19:23:42 +0100
parent 9572:867e40b82409
child 10654:a2bd6e85a457
comparison
equal deleted inserted replaced
10398:fa50789d6ec7 10399:270cb2821566
14 return event.origin.send(st.reply(event.stanza)); 14 return event.origin.send(st.reply(event.stanza));
15 end 15 end
16 16
17 module:hook("iq-get/bare/urn:xmpp:ping:ping", ping_handler); 17 module:hook("iq-get/bare/urn:xmpp:ping:ping", ping_handler);
18 module:hook("iq-get/host/urn:xmpp:ping:ping", ping_handler); 18 module:hook("iq-get/host/urn:xmpp:ping:ping", ping_handler);
19
20 -- Ad-hoc command
21
22 local datetime = require "util.datetime".datetime;
23
24 function ping_command_handler (self, data, state) -- luacheck: ignore 212
25 local now = datetime();
26 return { info = "Pong\n"..now, status = "completed" };
27 end
28
29 module:depends "adhoc";
30 local adhoc_new = module:require "adhoc".new;
31 local descriptor = adhoc_new("Ping", "ping", ping_command_handler);
32 module:provides("adhoc", descriptor);
33