degesch: add /stats

This commit is contained in:
Přemysl Eric Janouch 2015-06-17 20:29:17 +02:00
parent 7dbec0d273
commit e2a3b48114
1 changed files with 17 additions and 0 deletions

View File

@ -6508,6 +6508,20 @@ handle_command_motd (struct app_context *ctx, char *arguments)
return true; return true;
} }
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 static bool
handle_command_away (struct app_context *ctx, char *arguments) handle_command_away (struct app_context *ctx, char *arguments)
{ {
@ -6647,6 +6661,9 @@ g_command_handlers[] =
{ "motd", "Get the Message of The Day", { "motd", "Get the Message of The Day",
NULL, NULL,
handle_command_motd }, handle_command_motd },
{ "stats", "Query server statistics",
"[<query> [<target>]]",
handle_command_stats },
{ "away", "Set away status", { "away", "Set away status",
"[<text>]", "[<text>]",
handle_command_away }, handle_command_away },