From 64725b24bd9b96df06e09f2a2022a62e48b4c964 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Fri, 19 Jun 2015 22:16:44 +0200
Subject: kike: send RPL_ISUPPORT in response to VERSION
Most servers do it.
---
kike.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/kike.c b/kike.c
index c135ba9..637eb2c 100644
--- a/kike.c
+++ b/kike.c
@@ -1159,6 +1159,16 @@ irc_is_this_me (struct server_context *ctx, const char *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
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_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
--
cgit v1.2.3-70-g09d2