kike: send RPL_ISUPPORT in response to VERSION

Most servers do it.
This commit is contained in:
Přemysl Eric Janouch 2015-06-19 22:16:44 +02:00
parent 690e29c78e
commit 64725b24bd

22
kike.c
View File

@ -1159,6 +1159,16 @@ irc_is_this_me (struct server_context *ctx, const char *target)
|| str_map_find (&ctx->users, target); || str_map_find (&ctx->users, target);
} }
static void
irc_send_isupport (struct client *c)
{
// Only # channels, +e supported, +I supported, unlimited arguments to MODE
irc_send_reply (c, IRC_RPL_ISUPPORT, "CHANTYPES=# EXCEPTS INVEX MODES"
" TARGMAX=WHOIS:,LIST:,NAMES:,PRIVMSG:1,NOTICE:1,KICK:"
" NICKLEN=" XSTRINGIFY (IRC_MAX_NICKNAME)
" CHANNELLEN=" XSTRINGIFY (IRC_MAX_CHANNEL_NAME));
}
static void static void
irc_try_finish_registration (struct client *c) irc_try_finish_registration (struct client *c)
{ {
@ -1177,12 +1187,7 @@ irc_try_finish_registration (struct client *c)
irc_send_reply (c, IRC_RPL_MYINFO, ctx->server_name, PROGRAM_VERSION, irc_send_reply (c, IRC_RPL_MYINFO, ctx->server_name, PROGRAM_VERSION,
IRC_SUPPORTED_USER_MODES, IRC_SUPPORTED_CHAN_MODES); IRC_SUPPORTED_USER_MODES, IRC_SUPPORTED_CHAN_MODES);
// Only # channels, +e supported, +I supported, unlimited arguments to MODE irc_send_isupport (c);
irc_send_reply (c, IRC_RPL_ISUPPORT, "CHANTYPES=# EXCEPTS INVEX MODES"
" TARGMAX=WHOIS:,LIST:,NAMES:,PRIVMSG:1,NOTICE:1,KICK:"
" NICKLEN=" XSTRINGIFY (IRC_MAX_NICKNAME)
" CHANNELLEN=" XSTRINGIFY (IRC_MAX_CHANNEL_NAME));
irc_send_lusers (c); irc_send_lusers (c);
irc_send_motd (c); irc_send_motd (c);
@ -1552,10 +1557,11 @@ static void
irc_handle_version (const struct irc_message *msg, struct client *c) irc_handle_version (const struct irc_message *msg, struct client *c)
{ {
if (msg->params.len > 0 && !irc_is_this_me (c->ctx, msg->params.vector[0])) if (msg->params.len > 0 && !irc_is_this_me (c->ctx, msg->params.vector[0]))
irc_send_reply (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]); RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]);
else
irc_send_reply (c, IRC_RPL_VERSION, PROGRAM_VERSION, g_debug_mode, irc_send_reply (c, IRC_RPL_VERSION, PROGRAM_VERSION, g_debug_mode,
c->ctx->server_name, PROGRAM_NAME " " PROGRAM_VERSION); c->ctx->server_name, PROGRAM_NAME " " PROGRAM_VERSION);
irc_send_isupport (c);
} }
static void static void