summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-17 20:29:17 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-17 20:29:17 +0200
commite2a3b481147625979c886bd697617766d0f0a15d (patch)
treebbb19f84f9d37872e414b9281da9023e8a58ec90
parent7dbec0d27301ea972b837132d56e7dc356d714c6 (diff)
downloadxK-e2a3b481147625979c886bd697617766d0f0a15d.tar.gz
xK-e2a3b481147625979c886bd697617766d0f0a15d.tar.xz
xK-e2a3b481147625979c886bd697617766d0f0a15d.zip
degesch: add /stats
-rw-r--r--degesch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index 6b3520b..6f4a536 100644
--- a/degesch.c
+++ b/degesch.c
@@ -6509,6 +6509,20 @@ handle_command_motd (struct app_context *ctx, char *arguments)
}
static bool
+handle_command_stats (struct app_context *ctx, char *arguments)
+{
+ if (!server_command_check (ctx, "stats", true))
+ return true;
+
+ struct server *s = ctx->current_buffer->server;
+ if (*arguments)
+ irc_send (s, "STATS %s", arguments);
+ else
+ irc_send (s, "STATS");
+ return true;
+}
+
+static bool
handle_command_away (struct app_context *ctx, char *arguments)
{
if (!server_command_check (ctx, "away", true))
@@ -6647,6 +6661,9 @@ g_command_handlers[] =
{ "motd", "Get the Message of The Day",
NULL,
handle_command_motd },
+ { "stats", "Query server statistics",
+ "[<query> [<target>]]",
+ handle_command_stats },
{ "away", "Set away status",
"[<text>]",
handle_command_away },