diff options
-rw-r--r-- | kike.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -1160,6 +1160,16 @@ irc_is_this_me (struct server_context *ctx, const char *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 irc_try_finish_registration (struct client *c) { struct server_context *ctx = c->ctx; @@ -1177,12 +1187,7 @@ irc_try_finish_registration (struct client *c) irc_send_reply (c, IRC_RPL_MYINFO, ctx->server_name, PROGRAM_VERSION, IRC_SUPPORTED_USER_MODES, IRC_SUPPORTED_CHAN_MODES); - // 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)); - + irc_send_isupport (c); irc_send_lusers (c); irc_send_motd (c); @@ -1552,10 +1557,11 @@ static void 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])) - irc_send_reply (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]); - else - irc_send_reply (c, IRC_RPL_VERSION, PROGRAM_VERSION, g_debug_mode, - c->ctx->server_name, PROGRAM_NAME " " PROGRAM_VERSION); + RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[0]); + + irc_send_reply (c, IRC_RPL_VERSION, PROGRAM_VERSION, g_debug_mode, + c->ctx->server_name, PROGRAM_NAME " " PROGRAM_VERSION); + irc_send_isupport (c); } static void |