summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/kike.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kike.c b/src/kike.c
index 2b429d3..c191e02 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -923,6 +923,7 @@ enum
IRC_ERR_NOTEXTTOSEND = 412,
IRC_ERR_UNKNOWNCOMMAND = 421,
IRC_ERR_NOMOTD = 422,
+ IRC_ERR_NOADMININFO = 423,
IRC_ERR_NONICKNAMEGIVEN = 431,
IRC_ERR_ERRONEOUSNICKNAME = 432,
IRC_ERR_NICKNAMEINUSE = 433,
@@ -1000,6 +1001,7 @@ static const char *g_default_replies[] =
[IRC_ERR_NOTEXTTOSEND] = ":No text to send",
[IRC_ERR_UNKNOWNCOMMAND] = "%s: Unknown command",
[IRC_ERR_NOMOTD] = ":MOTD File is missing",
+ [IRC_ERR_NOADMININFO] = "%s :No administrative info available",
[IRC_ERR_NONICKNAMEGIVEN] = ":No nickname given",
[IRC_ERR_ERRONEOUSNICKNAME] = "%s :Erroneous nickname",
[IRC_ERR_NICKNAMEINUSE] = "%s :Nickname is already in use",
@@ -2129,6 +2131,14 @@ irc_handle_ison (const struct irc_message *msg, struct client *c)
}
static void
+irc_handle_admin (const struct irc_message *msg, struct client *c)
+{
+ if (msg->params.len > 0 && !irc_is_this_me (c->ctx, msg->params.vector[0]))
+ RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]);
+ irc_send_reply (c, IRC_ERR_NOADMININFO, c->ctx->server_name);
+}
+
+static void
irc_handle_kill (const struct irc_message *msg, struct client *c)
{
if (msg->params.len < 2)
@@ -2188,6 +2198,7 @@ irc_register_handlers (struct server_context *ctx)
{ "USERS", true, irc_handle_users },
{ "SUMMON", true, irc_handle_summon },
{ "AWAY", true, irc_handle_away },
+ { "ADMIN", true, irc_handle_admin },
{ "MODE", true, irc_handle_mode },
{ "PRIVMSG", true, irc_handle_privmsg },