summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-19 22:16:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-19 22:26:54 +0200
commit64725b24bd9b96df06e09f2a2022a62e48b4c964 (patch)
tree3ef57d0311db9e585cc435d1f42e78fddf5f2af9
parent690e29c78e565b1d0fa864f1d3bcd0b1fcc6c6a2 (diff)
downloadxK-64725b24bd9b96df06e09f2a2022a62e48b4c964.tar.gz
xK-64725b24bd9b96df06e09f2a2022a62e48b4c964.tar.xz
xK-64725b24bd9b96df06e09f2a2022a62e48b4c964.zip
kike: send RPL_ISUPPORT in response to VERSION
Most servers do it.
-rw-r--r--kike.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/kike.c b/kike.c
index c135ba9..637eb2c 100644
--- a/kike.c
+++ b/kike.c
@@ -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