kike: implement LINKS
This commit is contained in:
parent
ff10e1b652
commit
abc0e4f821
|
@ -41,6 +41,8 @@
|
||||||
351 IRC_RPL_VERSION "%s.%d %s :%s"
|
351 IRC_RPL_VERSION "%s.%d %s :%s"
|
||||||
352 IRC_RPL_WHOREPLY "%s %s %s %s %s %s :%d %s"
|
352 IRC_RPL_WHOREPLY "%s %s %s %s %s %s :%d %s"
|
||||||
353 IRC_RPL_NAMREPLY "%c %s :%s"
|
353 IRC_RPL_NAMREPLY "%c %s :%s"
|
||||||
|
364 IRC_RPL_LINKS "%s %s :%d %s"
|
||||||
|
365 IRC_RPL_ENDOFLINKS "%s :End of LINKS list"
|
||||||
366 IRC_RPL_ENDOFNAMES "%s :End of NAMES list"
|
366 IRC_RPL_ENDOFNAMES "%s :End of NAMES list"
|
||||||
367 IRC_RPL_BANLIST "%s %s"
|
367 IRC_RPL_BANLIST "%s %s"
|
||||||
368 IRC_RPL_ENDOFBANLIST "%s :End of channel ban list"
|
368 IRC_RPL_ENDOFBANLIST "%s :End of channel ban list"
|
||||||
|
|
18
kike.c
18
kike.c
|
@ -2917,6 +2917,23 @@ irc_handle_stats (const struct irc_message *msg, struct client *c)
|
||||||
irc_send_reply (c, IRC_RPL_ENDOFSTATS, query);
|
irc_send_reply (c, IRC_RPL_ENDOFSTATS, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
irc_handle_links (const struct irc_message *msg, struct client *c)
|
||||||
|
{
|
||||||
|
if (msg->params.len > 1 && !irc_is_this_me (c->ctx, msg->params.vector[0]))
|
||||||
|
RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]);
|
||||||
|
|
||||||
|
const char *mask = "*";
|
||||||
|
if (msg->params.len > 0)
|
||||||
|
mask = msg->params.vector[msg->params.len > 1];
|
||||||
|
|
||||||
|
if (!irc_fnmatch (mask, c->ctx->server_name))
|
||||||
|
irc_send_reply (c, IRC_RPL_LINKS, mask,
|
||||||
|
c->ctx->server_name, 0 /* hop count */,
|
||||||
|
str_map_find (&c->ctx->config, "server_info"));
|
||||||
|
irc_send_reply (c, IRC_RPL_ENDOFLINKS, mask);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
irc_handle_kill (const struct irc_message *msg, struct client *c)
|
irc_handle_kill (const struct irc_message *msg, struct client *c)
|
||||||
{
|
{
|
||||||
|
@ -2973,6 +2990,7 @@ irc_register_handlers (struct server_context *ctx)
|
||||||
{ "AWAY", true, irc_handle_away, 0, 0 },
|
{ "AWAY", true, irc_handle_away, 0, 0 },
|
||||||
{ "ADMIN", true, irc_handle_admin, 0, 0 },
|
{ "ADMIN", true, irc_handle_admin, 0, 0 },
|
||||||
{ "STATS", true, irc_handle_stats, 0, 0 },
|
{ "STATS", true, irc_handle_stats, 0, 0 },
|
||||||
|
{ "LINKS", true, irc_handle_links, 0, 0 },
|
||||||
|
|
||||||
{ "MODE", true, irc_handle_mode, 0, 0 },
|
{ "MODE", true, irc_handle_mode, 0, 0 },
|
||||||
{ "PRIVMSG", true, irc_handle_privmsg, 0, 0 },
|
{ "PRIVMSG", true, irc_handle_privmsg, 0, 0 },
|
||||||
|
|
Loading…
Reference in New Issue