Better support for the KILL command

This commit is contained in:
2016-09-23 22:50:30 +02:00
parent 26f94d2459
commit 92a4d4b5a7
2 changed files with 37 additions and 0 deletions

5
kike.c
View File

@@ -2991,6 +2991,11 @@ irc_handle_kill (const struct irc_message *msg, struct client *c)
struct client *target;
if (!(target = str_map_find (&c->ctx->users, msg->params.vector[0])))
RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHNICK, msg->params.vector[0]);
client_send (target, ":%s!%s@%s KILL %s :%s",
c->nickname, c->username, c->hostname,
target->nickname, msg->params.vector[1]);
char *reason = xstrdup_printf ("Killed by %s: %s",
c->nickname, msg->params.vector[1]);
client_close_link (target, reason);