From 01103cb02a40e32cf9bf0bc23799ba7cc67d30b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 15 Sep 2024 21:47:32 +0200 Subject: [PATCH] irc: do not strip trailing spaces from incoming IRC messages --- CHANGELOG.md | 1 + src/plugins/irc/irc-mode.c | 4 + src/plugins/irc/irc-protocol.c | 494 ++++++++-------- src/plugins/irc/irc-protocol.h | 5 +- tests/unit/plugins/irc/test-irc-protocol.cpp | 582 ++++++++++--------- 5 files changed, 546 insertions(+), 540 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f5a9d4c3..871ff7a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Fixed - core, plugins: fix integer overflow in loops ([#2178](https://github.com/weechat/weechat/issues/2178)) +- irc: do not strip trailing spaces from incoming IRC messages - relay/api: fix empty nicklist in remote buffers after connection or reconnection - lua: fix compilation on Fedora with Lua < 5.2.0 ([#2173](https://github.com/weechat/weechat/issues/2173), [#2174](https://github.com/weechat/weechat/issues/2174)) - core: fix build on Android ([#2180](https://github.com/weechat/weechat/issues/2180)) diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index 2dd95cc28..9c13ae8e5 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -672,6 +672,10 @@ irc_mode_user_set (struct t_irc_server *server, const char *modes, server->nick_modes = NULL; } } + while (modes && (modes[0] == ' ')) + { + modes++; + } set_flag = '+'; end = 0; while (modes && modes[0]) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 9e01da58f..83525b948 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -2238,7 +2238,7 @@ IRC_PROTOCOL_CALLBACK(nick) { struct t_irc_channel *ptr_channel, *ptr_channel_new_nick; struct t_irc_nick *ptr_nick, *ptr_nick_found; - char *old_color, *new_color, str_tags[512]; + char *nick, *old_color, *new_color, str_tags[512]; int smart_filter; struct t_irc_channel_speaking *ptr_nick_speaking; @@ -2248,9 +2248,16 @@ IRC_PROTOCOL_CALLBACK(nick) if (!ctxt->params[0][0]) return WEECHAT_RC_OK; + nick = weechat_string_strip (ctxt->params[0], 1, 1, " "); + if (!nick || !nick[0]) + { + free (nick); + return WEECHAT_RC_OK; + } + if (ctxt->nick_is_me) { - irc_server_set_nick (ctxt->server, ctxt->params[0]); + irc_server_set_nick (ctxt->server, nick); irc_server_set_host (ctxt->server, ctxt->address); } @@ -2265,7 +2272,7 @@ IRC_PROTOCOL_CALLBACK(nick) snprintf (str_tags, sizeof (str_tags), "irc_nick1_%s,irc_nick2_%s", ctxt->nick, - ctxt->params[0]); + nick); weechat_printf_datetime_tags ( ctxt->server->buffer, ctxt->date, @@ -2274,14 +2281,14 @@ IRC_PROTOCOL_CALLBACK(nick) _("%sYou are now known as %s%s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_NICK_SELF, - ctxt->params[0], + nick, IRC_COLOR_RESET); /* enable hotlist */ weechat_buffer_set (NULL, "hotlist", "+"); } - ptr_channel_new_nick = irc_channel_search (ctxt->server, ctxt->params[0]); + ptr_channel_new_nick = irc_channel_search (ctxt->server, nick); for (ptr_channel = ctxt->server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) @@ -2299,11 +2306,11 @@ IRC_PROTOCOL_CALLBACK(nick) && ((irc_server_strcasecmp (ctxt->server, ptr_channel->name, ctxt->nick) == 0) || ((irc_server_strcasecmp (ctxt->server, - ptr_channel->name, ctxt->params[0]) == 0) - && (strcmp (ptr_channel->name, ctxt->params[0]) != 0)))) + ptr_channel->name, nick) == 0) + && (strcmp (ptr_channel->name, nick) != 0)))) { /* rename private buffer */ - irc_channel_pv_rename (ctxt->server, ptr_channel, ctxt->params[0]); + irc_channel_pv_rename (ctxt->server, ptr_channel, nick); /* display message */ if (weechat_config_boolean (irc_config_look_display_pv_nick_change)) @@ -2313,7 +2320,7 @@ IRC_PROTOCOL_CALLBACK(nick) if (weechat_config_boolean (irc_config_look_color_pv_nick_like_channel)) { old_color = irc_nick_find_color (ctxt->nick); - new_color = irc_nick_find_color (ctxt->params[0]); + new_color = irc_nick_find_color (nick); } else { @@ -2329,7 +2336,7 @@ IRC_PROTOCOL_CALLBACK(nick) snprintf (str_tags, sizeof (str_tags), "irc_nick1_%s,irc_nick2_%s", ctxt->nick, - ctxt->params[0]); + nick); weechat_printf_datetime_tags ( ptr_channel->buffer, ctxt->date, @@ -2341,7 +2348,7 @@ IRC_PROTOCOL_CALLBACK(nick) ctxt->nick, IRC_COLOR_RESET, new_color, - ctxt->params[0], + nick, IRC_COLOR_RESET); free (old_color); free (new_color); @@ -2360,7 +2367,7 @@ IRC_PROTOCOL_CALLBACK(nick) /* change nick and display message on channel */ old_color = strdup (ptr_nick->color); - irc_nick_change (ctxt->server, ptr_channel, ptr_nick, ctxt->params[0]); + irc_nick_change (ctxt->server, ptr_channel, ptr_nick, nick); if (ctxt->nick_is_me) { /* temporary disable hotlist */ @@ -2369,7 +2376,7 @@ IRC_PROTOCOL_CALLBACK(nick) snprintf (str_tags, sizeof (str_tags), "irc_nick1_%s,irc_nick2_%s", ctxt->nick, - ctxt->params[0]); + nick); weechat_printf_datetime_tags ( ptr_channel->buffer, ctxt->date, @@ -2379,7 +2386,7 @@ IRC_PROTOCOL_CALLBACK(nick) _("%sYou are now known as %s%s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_NICK_SELF, - ctxt->params[0], + nick, IRC_COLOR_RESET); /* enable hotlist */ @@ -2402,7 +2409,7 @@ IRC_PROTOCOL_CALLBACK(nick) "%sirc_nick1_%s,irc_nick2_%s", (smart_filter) ? "irc_smart_filter," : "", ctxt->nick, - ctxt->params[0]); + nick); weechat_printf_datetime_tags ( ptr_channel->buffer, ctxt->date, @@ -2415,18 +2422,18 @@ IRC_PROTOCOL_CALLBACK(nick) ctxt->nick, IRC_COLOR_RESET, irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, - ctxt->params[0]), - ctxt->params[0], + nick), + nick, IRC_COLOR_RESET); } irc_channel_nick_speaking_rename (ptr_channel, - ctxt->nick, ctxt->params[0]); + ctxt->nick, nick); irc_channel_nick_speaking_time_rename (ctxt->server, ptr_channel, - ctxt->nick, ctxt->params[0]); + ctxt->nick, nick); irc_channel_join_smart_filtered_rename (ptr_channel, ctxt->nick, - ctxt->params[0]); + nick); } free (old_color); @@ -2437,11 +2444,13 @@ IRC_PROTOCOL_CALLBACK(nick) if (!ctxt->nick_is_me) { - irc_channel_display_nick_back_in_pv (ctxt->server, ptr_nick_found, ctxt->params[0]); + irc_channel_display_nick_back_in_pv (ctxt->server, ptr_nick_found, nick); irc_channel_set_topic_private_buffers (ctxt->server, ptr_nick_found, - ctxt->params[0], ctxt->address); + nick, ctxt->address); } + free (nick); + return WEECHAT_RC_OK; } @@ -3624,6 +3633,7 @@ IRC_PROTOCOL_CALLBACK(tagmsg) { struct t_irc_channel *ptr_channel; const char *ptr_typing_value; + char *channel; int state; IRC_PROTOCOL_MIN_PARAMS(1); @@ -3638,13 +3648,17 @@ IRC_PROTOCOL_CALLBACK(tagmsg) if (ctxt->nick_is_me) return WEECHAT_RC_OK; + channel = weechat_string_strip (ctxt->params[0], 1, 1, " "); + if (!channel) + return WEECHAT_RC_OK; + ptr_channel = NULL; - if (irc_channel_is_channel (ctxt->server, ctxt->params[0])) - ptr_channel = irc_channel_search (ctxt->server, ctxt->params[0]); - else if (irc_server_strcasecmp (ctxt->server, ctxt->params[0], ctxt->server->nick) == 0) + if (irc_channel_is_channel (ctxt->server, channel)) + ptr_channel = irc_channel_search (ctxt->server, channel); + else if (irc_server_strcasecmp (ctxt->server, channel, ctxt->server->nick) == 0) ptr_channel = irc_channel_search (ctxt->server, ctxt->nick); if (!ptr_channel) - return WEECHAT_RC_OK; + goto end; if (weechat_config_boolean (irc_config_look_typing_status_nicks)) { @@ -3661,6 +3675,9 @@ IRC_PROTOCOL_CALLBACK(tagmsg) } } +end: + free (channel); + return WEECHAT_RC_OK; } @@ -7271,45 +7288,6 @@ IRC_PROTOCOL_CALLBACK(470) return WEECHAT_RC_OK; } -/* - * Callback for the IRC commands "524", "704", "705", and "706": help reply. - * - * Commands look like: - * 704 mynick topic :First help line of - * 705 mynick topic :The is blah blah - * 705 mynick topic :and this - * 705 mynick topic :and that. - * 706 mynick topic :End of /HELPOP - * - * Or: - * 524 mynick topic :help not found - */ - -IRC_PROTOCOL_CALLBACK(help) -{ - char *str_message; - - IRC_PROTOCOL_MIN_PARAMS(2); - - if (ctxt->ignore_remove) - return WEECHAT_RC_OK; - - str_message = irc_protocol_string_params (ctxt->params, 2, ctxt->num_params - 1); - - weechat_printf_datetime_tags ( - irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick, ctxt->command, NULL, NULL), - ctxt->date, - ctxt->date_usec, - irc_protocol_tags (ctxt, "notify_private"), - "%s%s", - weechat_prefix ("network"), - str_message); - - free (str_message); - - return WEECHAT_RC_OK; -} - /* * Callback for the IRC command "710": has asked for an invite (knock). * @@ -7555,14 +7533,23 @@ IRC_PROTOCOL_CALLBACK(730) { struct t_irc_notify *ptr_notify; const char *monitor_nick, *monitor_host; - char *str_nicks, **nicks; + char *str_nicks, *str_nicks2, **nicks; int i, num_nicks; IRC_PROTOCOL_MIN_PARAMS(2); str_nicks = irc_protocol_string_params (ctxt->params, 1, ctxt->num_params - 1); + if (!str_nicks) + return WEECHAT_RC_OK; - nicks = weechat_string_split (str_nicks, + str_nicks2 = weechat_string_strip (str_nicks, 1, 1, " "); + if (!str_nicks2) + { + free (str_nicks); + return WEECHAT_RC_OK; + } + + nicks = weechat_string_split (str_nicks2, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT @@ -7596,6 +7583,7 @@ IRC_PROTOCOL_CALLBACK(730) } free (str_nicks); + free (str_nicks2); return WEECHAT_RC_OK; } @@ -7612,14 +7600,23 @@ IRC_PROTOCOL_CALLBACK(731) { struct t_irc_notify *ptr_notify; const char *monitor_nick, *monitor_host; - char *str_nicks, **nicks; + char *str_nicks, *str_nicks2, **nicks; int i, num_nicks; IRC_PROTOCOL_MIN_PARAMS(2); str_nicks = irc_protocol_string_params (ctxt->params, 1, ctxt->num_params - 1); + if (!str_nicks) + return WEECHAT_RC_OK; - nicks = weechat_string_split (str_nicks, + str_nicks2 = weechat_string_strip (str_nicks, 1, 1, " "); + if (!str_nicks2) + { + free (str_nicks); + return WEECHAT_RC_OK; + } + + nicks = weechat_string_split (str_nicks2, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT @@ -7653,6 +7650,7 @@ IRC_PROTOCOL_CALLBACK(731) } free (str_nicks); + free (str_nicks2); return WEECHAT_RC_OK; } @@ -7666,12 +7664,13 @@ IRC_PROTOCOL_CALLBACK(731) IRC_PROTOCOL_CALLBACK(732) { - char *str_nicks; + char *str_nicks, *str_nicks2; IRC_PROTOCOL_MIN_PARAMS(1); str_nicks = (ctxt->num_params > 1) ? irc_protocol_string_params (ctxt->params, 1, ctxt->num_params - 1) : NULL; + str_nicks2 = (str_nicks) ? weechat_string_strip (str_nicks, 1, 1, " ") : NULL; weechat_printf_datetime_tags ( irc_msgbuffer_get_target_buffer ( @@ -7681,9 +7680,10 @@ IRC_PROTOCOL_CALLBACK(732) irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), - (str_nicks) ? str_nicks : ""); + (str_nicks2) ? str_nicks2 : ""); free (str_nicks); + free (str_nicks2); return WEECHAT_RC_OK; } @@ -7915,7 +7915,7 @@ irc_protocol_recv_command (struct t_irc_server *server, const char *msg_channel, int ignore_batch_tag) { - int i, cmd_found, return_code, decode_color, keep_trailing_spaces, ignored; + int i, cmd_found, return_code, decode_color, ignored; char *message_colors_decoded, *pos_space, *tags; struct t_irc_channel *ptr_channel; t_irc_recv_func *cmd_recv_func; @@ -7926,178 +7926,178 @@ irc_protocol_recv_command (struct t_irc_server *server, struct timeval tv; struct t_irc_protocol_msg irc_protocol_messages[] = { - /* format: "command", decode_color, keep_trailing_spaces, func_cb */ - IRCB(account, 1, 0, account), /* account (cap "account-notify") */ - IRCB(authenticate, 1, 0, authenticate), /* authenticate */ - IRCB(away, 1, 0, away), /* away (cap "away-notify") */ - IRCB(batch, 1, 0, batch), /* batch (cap "batch") */ - IRCB(cap, 1, 0, cap), /* client capability */ - IRCB(chghost, 1, 0, chghost), /* user/host change (cap "chghost")*/ - IRCB(error, 1, 0, error), /* error received from server */ - IRCB(fail, 1, 0, fail), /* error received from server */ - IRCB(invite, 1, 0, invite), /* invite a nick on a channel */ - IRCB(join, 1, 0, join), /* join a channel */ - IRCB(kick, 1, 1, kick), /* kick a user */ - IRCB(kill, 1, 1, kill), /* close client-server connection */ - IRCB(mode, 1, 0, mode), /* change channel or user mode */ - IRCB(nick, 1, 0, nick), /* change current nickname */ - IRCB(note, 1, 0, note), /* note received from server */ - IRCB(notice, 1, 1, notice), /* send notice message to user */ - IRCB(part, 1, 1, part), /* leave a channel */ - IRCB(ping, 1, 0, ping), /* ping server */ - IRCB(pong, 1, 0, pong), /* answer to a ping message */ - IRCB(privmsg, 1, 1, privmsg), /* message received */ - IRCB(quit, 1, 1, quit), /* close all connections and quit */ - IRCB(setname, 0, 1, setname), /* set realname */ - IRCB(tagmsg, 0, 0, tagmsg), /* tag message */ - IRCB(topic, 0, 1, topic), /* get/set channel topic */ - IRCB(wallops, 1, 1, wallops), /* wallops */ - IRCB(warn, 1, 0, warn), /* warning received from server */ - IRCB(001, 1, 0, 001), /* a server message */ - IRCB(005, 1, 0, 005), /* a server message */ - IRCB(008, 1, 0, 008), /* server notice mask */ - IRCB(221, 1, 0, 221), /* user mode string */ - IRCB(223, 1, 0, whois_nick_msg), /* whois (charset is) */ - IRCB(264, 1, 0, whois_nick_msg), /* whois (encrypted connection) */ - IRCB(275, 1, 0, whois_nick_msg), /* whois (secure connection) */ - IRCB(276, 1, 0, whois_nick_msg), /* whois (client cert. fingerprint)*/ - IRCB(301, 1, 1, 301), /* away message */ - IRCB(303, 1, 0, 303), /* ison */ - IRCB(305, 1, 0, 305), /* unaway */ - IRCB(306, 1, 0, 306), /* now away */ - IRCB(307, 1, 0, whois_nick_msg), /* whois (registered nick) */ - IRCB(310, 1, 0, whois_nick_msg), /* whois (help mode) */ - IRCB(311, 1, 0, 311), /* whois (user) */ - IRCB(312, 1, 0, 312), /* whois (server) */ - IRCB(313, 1, 0, whois_nick_msg), /* whois (operator) */ - IRCB(314, 1, 0, 314), /* whowas */ - IRCB(315, 1, 0, 315), /* end of /who list */ - IRCB(317, 1, 0, 317), /* whois (idle) */ - IRCB(318, 1, 0, whois_nick_msg), /* whois (end) */ - IRCB(319, 1, 0, whois_nick_msg), /* whois (channels) */ - IRCB(320, 1, 0, whois_nick_msg), /* whois (identified user) */ - IRCB(321, 1, 0, 321), /* /list start */ - IRCB(322, 1, 1, 322), /* channel (for /list) */ - IRCB(323, 1, 0, 323), /* end of /list */ - IRCB(324, 1, 0, 324), /* channel mode */ - IRCB(326, 1, 0, whois_nick_msg), /* whois (has oper privs) */ - IRCB(327, 1, 0, 327), /* whois (host) */ - IRCB(328, 1, 0, 328), /* channel URL */ - IRCB(329, 1, 0, 329), /* channel creation date */ - IRCB(330, 1, 0, 330_343), /* is logged in as */ - IRCB(331, 1, 0, 331), /* no topic for channel */ - IRCB(332, 0, 1, 332), /* topic of channel */ - IRCB(333, 1, 0, 333), /* topic info (nick/date) */ - IRCB(335, 1, 0, whois_nick_msg), /* whois (is a bot on) */ - IRCB(337, 1, 0, whois_nick_msg), /* whois (is hiding idle time) */ - IRCB(338, 1, 0, 338), /* whois (host) */ - IRCB(341, 1, 0, 341), /* inviting */ - IRCB(343, 1, 0, 330_343), /* is opered as */ - IRCB(344, 1, 0, 344), /* channel reop / whois (geo info) */ - IRCB(345, 1, 0, 345), /* end of channel reop list */ - IRCB(346, 1, 0, 346), /* invite list */ - IRCB(347, 1, 0, 347), /* end of invite list */ - IRCB(348, 1, 0, 348), /* channel exception list */ - IRCB(349, 1, 0, 349), /* end of channel exception list */ - IRCB(350, 1, 0, 350), /* whois (gateway) */ - IRCB(351, 1, 0, 351), /* server version */ - IRCB(352, 1, 0, 352), /* who */ - IRCB(353, 1, 0, 353), /* list of nicks on channel */ - IRCB(354, 1, 0, 354), /* whox */ - IRCB(366, 1, 0, 366), /* end of /names list */ - IRCB(367, 1, 0, 367), /* banlist */ - IRCB(368, 1, 0, 368), /* end of banlist */ - IRCB(369, 1, 0, whowas_nick_msg), /* whowas (end) */ - IRCB(378, 1, 0, whois_nick_msg), /* whois (connecting from) */ - IRCB(379, 1, 0, whois_nick_msg), /* whois (using modes) */ - IRCB(401, 1, 0, generic_error), /* no such nick/channel */ - IRCB(402, 1, 0, generic_error), /* no such server */ - IRCB(403, 1, 0, generic_error), /* no such channel */ - IRCB(404, 1, 0, generic_error), /* cannot send to channel */ - IRCB(405, 1, 0, generic_error), /* too many channels */ - IRCB(406, 1, 0, generic_error), /* was no such nick */ - IRCB(407, 1, 0, generic_error), /* was no such nick */ - IRCB(409, 1, 0, generic_error), /* no origin */ - IRCB(410, 1, 0, generic_error), /* no services */ - IRCB(411, 1, 0, generic_error), /* no recipient */ - IRCB(412, 1, 0, generic_error), /* no text to send */ - IRCB(413, 1, 0, generic_error), /* no toplevel */ - IRCB(414, 1, 0, generic_error), /* wilcard in toplevel domain */ - IRCB(415, 1, 0, generic_error), /* cannot send message to channel */ - IRCB(421, 1, 0, generic_error), /* unknown command */ - IRCB(422, 1, 0, generic_error), /* MOTD is missing */ - IRCB(423, 1, 0, generic_error), /* no administrative info */ - IRCB(424, 1, 0, generic_error), /* file error */ - IRCB(431, 1, 0, generic_error), /* no nickname given */ - IRCB(432, 1, 0, 432), /* erroneous nickname */ - IRCB(433, 1, 0, 433), /* nickname already in use */ - IRCB(436, 1, 0, generic_error), /* nickname collision */ - IRCB(437, 1, 0, 437), /* nick/channel unavailable */ - IRCB(438, 1, 0, 438), /* not auth. to change nickname */ - IRCB(441, 1, 0, generic_error), /* user not in channel */ - IRCB(442, 1, 0, generic_error), /* not on channel */ - IRCB(443, 1, 0, generic_error), /* user already on channel */ - IRCB(444, 1, 0, generic_error), /* user not logged in */ - IRCB(445, 1, 0, generic_error), /* summon has been disabled */ - IRCB(446, 1, 0, generic_error), /* users has been disabled */ - IRCB(451, 1, 0, generic_error), /* you are not registered */ - IRCB(461, 1, 0, generic_error), /* not enough parameters */ - IRCB(462, 1, 0, generic_error), /* you may not register */ - IRCB(463, 1, 0, generic_error), /* host not privileged */ - IRCB(464, 1, 0, generic_error), /* password incorrect */ - IRCB(465, 1, 0, generic_error), /* banned from this server */ - IRCB(467, 1, 0, generic_error), /* channel key already set */ - IRCB(470, 1, 0, 470), /* forwarding to another channel */ - IRCB(471, 1, 0, generic_error), /* channel is already full */ - IRCB(472, 1, 0, generic_error), /* unknown mode char to me */ - IRCB(473, 1, 0, generic_error), /* cannot join (invite only) */ - IRCB(474, 1, 0, generic_error), /* cannot join (banned) */ - IRCB(475, 1, 0, generic_error), /* cannot join (bad key) */ - IRCB(476, 1, 0, generic_error), /* bad channel mask */ - IRCB(477, 1, 0, generic_error), /* channel doesn't support modes */ - IRCB(481, 1, 0, generic_error), /* you're not an IRC operator */ - IRCB(482, 1, 0, generic_error), /* you're not channel operator */ - IRCB(483, 1, 0, generic_error), /* you can't kill a server! */ - IRCB(484, 1, 0, generic_error), /* your connection is restricted! */ - IRCB(485, 1, 0, generic_error), /* user immune from kick/deop */ - IRCB(487, 1, 0, generic_error), /* network split */ - IRCB(491, 1, 0, generic_error), /* no O-lines for your host */ - IRCB(501, 1, 0, generic_error), /* unknown mode flag */ - IRCB(502, 1, 0, generic_error), /* can't chg mode for other users */ - IRCB(524, 1, 0, help), /* HELP/HELPOP (help not found) */ - IRCB(569, 1, 0, whois_nick_msg), /* whois (connecting from) */ - IRCB(671, 1, 0, whois_nick_msg), /* whois (secure connection) */ - IRCB(704, 1, 0, help), /* start of HELP/HELPOP */ - IRCB(705, 1, 0, help), /* body of HELP/HELPOP */ - IRCB(706, 1, 0, help), /* end of HELP/HELPOP */ - IRCB(710, 1, 0, 710), /* knock: has asked for an invite */ - IRCB(711, 1, 0, knock_reply), /* knock: has been delivered */ - IRCB(712, 1, 0, knock_reply), /* knock: too many knocks */ - IRCB(713, 1, 0, knock_reply), /* knock: channel is open */ - IRCB(714, 1, 0, knock_reply), /* knock: already on that channel */ - IRCB(716, 1, 0, generic_error), /* nick is in +g mode */ - IRCB(717, 1, 0, generic_error), /* nick has been informed of msg */ - IRCB(728, 1, 0, 728), /* quietlist */ - IRCB(729, 1, 0, 729), /* end of quietlist */ - IRCB(730, 1, 0, 730), /* monitored nicks online */ - IRCB(731, 1, 0, 731), /* monitored nicks offline */ - IRCB(732, 1, 0, 732), /* list of monitored nicks */ - IRCB(733, 1, 0, 733), /* end of monitor list */ - IRCB(734, 1, 0, 734), /* monitor list is full */ - IRCB(742, 1, 0, generic_error), /* mode cannot be set */ - IRCB(900, 1, 0, 900), /* logged in as (SASL) */ - IRCB(901, 1, 0, 901), /* you are now logged out */ - IRCB(902, 1, 0, sasl_end_fail), /* SASL auth failed (acc. locked) */ - IRCB(903, 1, 0, sasl_end_ok), /* SASL auth successful */ - IRCB(904, 1, 0, sasl_end_fail), /* SASL auth failed */ - IRCB(905, 1, 0, sasl_end_fail), /* SASL message too long */ - IRCB(906, 1, 0, sasl_end_fail), /* SASL authentication aborted */ - IRCB(907, 1, 0, sasl_end_ok), /* already completed SASL auth */ - IRCB(936, 1, 0, generic_error), /* censored word */ - IRCB(973, 1, 0, server_mode_reason), /* whois (secure conn.) */ - IRCB(974, 1, 0, server_mode_reason), /* whois (secure conn.) */ - IRCB(975, 1, 0, server_mode_reason), /* whois (secure conn.) */ - { NULL, 0, 0, NULL }, + /* format: "command", decode_color, func_cb */ + IRCB(account, 1, account), /* account (cap "account-notify") */ + IRCB(authenticate, 1, authenticate), /* authenticate */ + IRCB(away, 1, away), /* away (cap "away-notify") */ + IRCB(batch, 1, batch), /* batch (cap "batch") */ + IRCB(cap, 1, cap), /* client capability */ + IRCB(chghost, 1, chghost), /* user/host change (cap "chghost")*/ + IRCB(error, 1, error), /* error received from server */ + IRCB(fail, 1, fail), /* error received from server */ + IRCB(invite, 1, invite), /* invite a nick on a channel */ + IRCB(join, 1, join), /* join a channel */ + IRCB(kick, 1, kick), /* kick a user */ + IRCB(kill, 1, kill), /* close client-server connection */ + IRCB(mode, 1, mode), /* change channel or user mode */ + IRCB(nick, 1, nick), /* change current nickname */ + IRCB(note, 1, note), /* note received from server */ + IRCB(notice, 1, notice), /* send notice message to user */ + IRCB(part, 1, part), /* leave a channel */ + IRCB(ping, 1, ping), /* ping server */ + IRCB(pong, 1, pong), /* answer to a ping message */ + IRCB(privmsg, 1, privmsg), /* message received */ + IRCB(quit, 1, quit), /* close all connections and quit */ + IRCB(setname, 0, setname), /* set realname */ + IRCB(tagmsg, 0, tagmsg), /* tag message */ + IRCB(topic, 0, topic), /* get/set channel topic */ + IRCB(wallops, 1, wallops), /* wallops */ + IRCB(warn, 1, warn), /* warning received from server */ + IRCB(001, 1, 001), /* a server message */ + IRCB(005, 1, 005), /* a server message */ + IRCB(008, 1, 008), /* server notice mask */ + IRCB(221, 1, 221), /* user mode string */ + IRCB(223, 1, whois_nick_msg), /* whois (charset is) */ + IRCB(264, 1, whois_nick_msg), /* whois (encrypted connection) */ + IRCB(275, 1, whois_nick_msg), /* whois (secure connection) */ + IRCB(276, 1, whois_nick_msg), /* whois (client cert. fingerprint)*/ + IRCB(301, 1, 301), /* away message */ + IRCB(303, 1, 303), /* ison */ + IRCB(305, 1, 305), /* unaway */ + IRCB(306, 1, 306), /* now away */ + IRCB(307, 1, whois_nick_msg), /* whois (registered nick) */ + IRCB(310, 1, whois_nick_msg), /* whois (help mode) */ + IRCB(311, 1, 311), /* whois (user) */ + IRCB(312, 1, 312), /* whois (server) */ + IRCB(313, 1, whois_nick_msg), /* whois (operator) */ + IRCB(314, 1, 314), /* whowas */ + IRCB(315, 1, 315), /* end of /who list */ + IRCB(317, 1, 317), /* whois (idle) */ + IRCB(318, 1, whois_nick_msg), /* whois (end) */ + IRCB(319, 1, whois_nick_msg), /* whois (channels) */ + IRCB(320, 1, whois_nick_msg), /* whois (identified user) */ + IRCB(321, 1, 321), /* /list start */ + IRCB(322, 1, 322), /* channel (for /list) */ + IRCB(323, 1, 323), /* end of /list */ + IRCB(324, 1, 324), /* channel mode */ + IRCB(326, 1, whois_nick_msg), /* whois (has oper privs) */ + IRCB(327, 1, 327), /* whois (host) */ + IRCB(328, 1, 328), /* channel URL */ + IRCB(329, 1, 329), /* channel creation date */ + IRCB(330, 1, 330_343), /* is logged in as */ + IRCB(331, 1, 331), /* no topic for channel */ + IRCB(332, 0, 332), /* topic of channel */ + IRCB(333, 1, 333), /* topic info (nick/date) */ + IRCB(335, 1, whois_nick_msg), /* whois (is a bot on) */ + IRCB(337, 1, whois_nick_msg), /* whois (is hiding idle time) */ + IRCB(338, 1, 338), /* whois (host) */ + IRCB(341, 1, 341), /* inviting */ + IRCB(343, 1, 330_343), /* is opered as */ + IRCB(344, 1, 344), /* channel reop / whois (geo info) */ + IRCB(345, 1, 345), /* end of channel reop list */ + IRCB(346, 1, 346), /* invite list */ + IRCB(347, 1, 347), /* end of invite list */ + IRCB(348, 1, 348), /* channel exception list */ + IRCB(349, 1, 349), /* end of channel exception list */ + IRCB(350, 1, 350), /* whois (gateway) */ + IRCB(351, 1, 351), /* server version */ + IRCB(352, 1, 352), /* who */ + IRCB(353, 1, 353), /* list of nicks on channel */ + IRCB(354, 1, 354), /* whox */ + IRCB(366, 1, 366), /* end of /names list */ + IRCB(367, 1, 367), /* banlist */ + IRCB(368, 1, 368), /* end of banlist */ + IRCB(369, 1, whowas_nick_msg), /* whowas (end) */ + IRCB(378, 1, whois_nick_msg), /* whois (connecting from) */ + IRCB(379, 1, whois_nick_msg), /* whois (using modes) */ + IRCB(401, 1, generic_error), /* no such nick/channel */ + IRCB(402, 1, generic_error), /* no such server */ + IRCB(403, 1, generic_error), /* no such channel */ + IRCB(404, 1, generic_error), /* cannot send to channel */ + IRCB(405, 1, generic_error), /* too many channels */ + IRCB(406, 1, generic_error), /* was no such nick */ + IRCB(407, 1, generic_error), /* too many targets */ + IRCB(409, 1, generic_error), /* no origin */ + IRCB(410, 1, generic_error), /* no services */ + IRCB(411, 1, generic_error), /* no recipient */ + IRCB(412, 1, generic_error), /* no text to send */ + IRCB(413, 1, generic_error), /* no toplevel */ + IRCB(414, 1, generic_error), /* wilcard in toplevel domain */ + IRCB(415, 1, generic_error), /* cannot send message to channel */ + IRCB(421, 1, generic_error), /* unknown command */ + IRCB(422, 1, generic_error), /* MOTD is missing */ + IRCB(423, 1, generic_error), /* no administrative info */ + IRCB(424, 1, generic_error), /* file error */ + IRCB(431, 1, generic_error), /* no nickname given */ + IRCB(432, 1, 432), /* erroneous nickname */ + IRCB(433, 1, 433), /* nickname already in use */ + IRCB(436, 1, generic_error), /* nickname collision */ + IRCB(437, 1, 437), /* nick/channel unavailable */ + IRCB(438, 1, 438), /* not auth. to change nickname */ + IRCB(441, 1, generic_error), /* user not in channel */ + IRCB(442, 1, generic_error), /* not on channel */ + IRCB(443, 1, generic_error), /* user already on channel */ + IRCB(444, 1, generic_error), /* user not logged in */ + IRCB(445, 1, generic_error), /* SUMMON has been disabled */ + IRCB(446, 1, generic_error), /* USERS has been disabled */ + IRCB(451, 1, generic_error), /* you are not registered */ + IRCB(461, 1, generic_error), /* not enough parameters */ + IRCB(462, 1, generic_error), /* you may not reregister */ + IRCB(463, 1, generic_error), /* host not privileged */ + IRCB(464, 1, generic_error), /* password incorrect */ + IRCB(465, 1, generic_error), /* banned from this server */ + IRCB(467, 1, generic_error), /* channel key already set */ + IRCB(470, 1, 470), /* forwarding to another channel */ + IRCB(471, 1, generic_error), /* channel is already full */ + IRCB(472, 1, generic_error), /* unknown mode char to me */ + IRCB(473, 1, generic_error), /* cannot join (invite only) */ + IRCB(474, 1, generic_error), /* cannot join (banned) */ + IRCB(475, 1, generic_error), /* cannot join (bad key) */ + IRCB(476, 1, generic_error), /* bad channel mask */ + IRCB(477, 1, generic_error), /* channel doesn't support modes */ + IRCB(481, 1, generic_error), /* you're not an IRC operator */ + IRCB(482, 1, generic_error), /* you're not channel operator */ + IRCB(483, 1, generic_error), /* you can't kill a server! */ + IRCB(484, 1, generic_error), /* your connection is restricted! */ + IRCB(485, 1, generic_error), /* not the original channel oper. */ + IRCB(487, 1, generic_error), /* network split */ + IRCB(491, 1, generic_error), /* no O-lines for your host */ + IRCB(501, 1, generic_error), /* unknown mode flag */ + IRCB(502, 1, generic_error), /* can't chg mode for other users */ + IRCB(524, 1, generic_error), /* HELP/HELPOP (help not found) */ + IRCB(569, 1, whois_nick_msg), /* whois (connecting from) */ + IRCB(671, 1, whois_nick_msg), /* whois (secure connection) */ + IRCB(704, 1, generic_error), /* start of HELP/HELPOP */ + IRCB(705, 1, generic_error), /* body of HELP/HELPOP */ + IRCB(706, 1, generic_error), /* end of HELP/HELPOP */ + IRCB(710, 1, 710), /* knock: has asked for an invite */ + IRCB(711, 1, knock_reply), /* knock: has been delivered */ + IRCB(712, 1, knock_reply), /* knock: too many knocks */ + IRCB(713, 1, knock_reply), /* knock: channel is open */ + IRCB(714, 1, knock_reply), /* knock: already on that channel */ + IRCB(716, 1, generic_error), /* nick is in +g mode */ + IRCB(717, 1, generic_error), /* nick has been informed of msg */ + IRCB(728, 1, 728), /* quietlist */ + IRCB(729, 1, 729), /* end of quietlist */ + IRCB(730, 1, 730), /* monitored nicks online */ + IRCB(731, 1, 731), /* monitored nicks offline */ + IRCB(732, 1, 732), /* list of monitored nicks */ + IRCB(733, 1, 733), /* end of monitor list */ + IRCB(734, 1, 734), /* monitor list is full */ + IRCB(742, 1, generic_error), /* mode cannot be set */ + IRCB(900, 1, 900), /* logged in as (SASL) */ + IRCB(901, 1, 901), /* you are now logged out */ + IRCB(902, 1, sasl_end_fail), /* SASL auth failed (acc. locked) */ + IRCB(903, 1, sasl_end_ok), /* SASL auth successful */ + IRCB(904, 1, sasl_end_fail), /* SASL auth failed */ + IRCB(905, 1, sasl_end_fail), /* SASL message too long */ + IRCB(906, 1, sasl_end_fail), /* SASL authentication aborted */ + IRCB(907, 1, sasl_end_ok), /* already completed SASL auth */ + IRCB(936, 1, generic_error), /* censored word */ + IRCB(973, 1, server_mode_reason), /* whois (secure conn.) */ + IRCB(974, 1, server_mode_reason), /* whois (secure conn.) */ + IRCB(975, 1, server_mode_reason), /* whois (secure conn.) */ + { NULL, 0, NULL }, }; if (!msg_command) @@ -8263,7 +8263,6 @@ irc_protocol_recv_command (struct t_irc_server *server, { ctxt.command = (msg_command) ? strdup (msg_command) : NULL; decode_color = 1; - keep_trailing_spaces = 0; cmd_recv_func = irc_protocol_cb_numeric; } else @@ -8279,7 +8278,6 @@ irc_protocol_recv_command (struct t_irc_server *server, { ctxt.command = strdup (irc_protocol_messages[cmd_found].name); decode_color = irc_protocol_messages[cmd_found].decode_color; - keep_trailing_spaces = irc_protocol_messages[cmd_found].keep_trailing_spaces; cmd_recv_func = irc_protocol_messages[cmd_found].recv_function; } @@ -8295,9 +8293,7 @@ irc_protocol_recv_command (struct t_irc_server *server, { message_colors_decoded = strdup (ptr_msg_after_tags); } - ctxt.irc_message = (keep_trailing_spaces) ? - strdup (message_colors_decoded) : - weechat_string_strip (message_colors_decoded, 0, 1, " "); + ctxt.irc_message = strdup (message_colors_decoded); irc_message_parse (server, ctxt.irc_message, diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h index 62d6181bf..58dc6dd45 100644 --- a/src/plugins/irc/irc-protocol.h +++ b/src/plugins/irc/irc-protocol.h @@ -27,11 +27,9 @@ irc_protocol_cb_##__command ( \ struct t_irc_protocol_ctxt *ctxt) -#define IRCB(__message, __decode_color, __keep_trailing_spaces, \ - __func_cb) \ +#define IRCB(__message, __decode_color, __func_cb) \ { #__message, \ __decode_color, \ - __keep_trailing_spaces, \ &irc_protocol_cb_##__func_cb } #define IRC_PROTOCOL_MIN_PARAMS(__min_params) \ @@ -83,7 +81,6 @@ struct t_irc_protocol_msg { char *name; /* IRC message name */ int decode_color; /* decode color before calling function */ - int keep_trailing_spaces; /* keep trailing spaces in message */ t_irc_recv_func *recv_function; /* function called when msg is received */ }; diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index ae7632796..a97874988 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -1312,20 +1312,20 @@ TEST(IrcProtocolWithServer, account_with_account_notify_cap) "irc_account,nick_alice,host_user@host,log3"); STRCMP_EQUAL("new_account", ptr_nick->account); - RECV(":alice!user@host ACCOUNT :new_account2"); - CHECK_CHAN("--", "alice has identified as new_account2", + RECV(":alice!user@host ACCOUNT : new account with spaces "); + CHECK_CHAN("--", "alice has identified as new account with spaces ", "irc_account,nick_alice,host_user@host,log3"); - STRCMP_EQUAL("new_account2", ptr_nick->account); + STRCMP_EQUAL(" new account with spaces ", ptr_nick->account); RECV(":alice!user@host ACCOUNT *"); CHECK_CHAN("--", "alice has unidentified", "irc_account,nick_alice,host_user@host,log3"); STRCMP_EQUAL(NULL, ptr_nick->account); - RECV(":alice!user@host ACCOUNT :new_account3"); - CHECK_CHAN("--", "alice has identified as new_account3", + RECV(":alice!user@host ACCOUNT :new_account2"); + CHECK_CHAN("--", "alice has identified as new_account2", "irc_account,nick_alice,host_user@host,log3"); - STRCMP_EQUAL("new_account3", ptr_nick->account); + STRCMP_EQUAL("new_account2", ptr_nick->account); RECV(":alice!user@host ACCOUNT :*"); CHECK_CHAN("--", "alice has unidentified", @@ -1351,10 +1351,10 @@ TEST(IrcProtocolWithServer, authenticate) CHECK_ERROR_PARAMS("authenticate", 0, 1); RECV("AUTHENTICATE " - "QQDaUzXAmVffxuzFy77XWBGwABBQAgdinelBrKZaR3wE7nsIETuTVY="); + "QQDaUzXAmVffxuzFy77XWBGwABBQAgdinelBrKZaR3wE7nsIETuTVY= "); CHECK_NO_MSG; RECV(":server.address AUTHENTICATE " - "QQDaUzXAmVffxuzFy77XWBGwABBQAgdinelBrKZaR3wE7nsIETuTVY="); + "QQDaUzXAmVffxuzFy77XWBGwABBQAgdinelBrKZaR3wE7nsIETuTVY= "); CHECK_NO_MSG; } @@ -1381,7 +1381,7 @@ TEST(IrcProtocolWithServer, away) CHECK_NO_MSG; LONGS_EQUAL(1, ptr_nick->away); - RECV(":alice!user@host AWAY :Holidays now!"); + RECV(":alice!user@host AWAY : Holidays now! "); CHECK_NO_MSG; LONGS_EQUAL(1, ptr_nick->away); @@ -1416,8 +1416,8 @@ TEST(IrcProtocolWithServer, batch_without_batch_cap) POINTERS_EQUAL(NULL, irc_batch_search (ptr_server, "ref")); /* new messages with batch reference */ - RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test :this is a test"); - CHECK_CHAN("bob", "this is a test", + RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test : this is a test "); + CHECK_CHAN("bob", " this is a test ", "irc_privmsg,irc_tag_batch=ref,notify_message," "prefix_nick_248,nick_bob,host_user_b@host_b,log1"); RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test :second test"); @@ -1564,7 +1564,7 @@ TEST(IrcProtocolWithServer, batch_with_batch_cap) POINTERS_EQUAL(NULL, ptr_server->batches); /* start batch without parameters */ - RECV(":server BATCH +ref example"); + RECV(":server BATCH +ref example "); CHECK_NO_MSG; ptr_batch = irc_batch_search (ptr_server, "ref"); CHECK(ptr_batch); @@ -1576,14 +1576,14 @@ TEST(IrcProtocolWithServer, batch_with_batch_cap) LONGS_EQUAL(0, ptr_batch->messages_processed); /* new messages with batch reference */ - RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test :this is a test"); + RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test : this is a test "); RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test :second test"); RECV("@batch=ref :bob!user_b@host_b PRIVMSG #test :third test"); CHECK_NO_MSG; /* end batch */ RECV(":server BATCH -ref"); - CHECK_CHAN("bob", "this is a test", + CHECK_CHAN("bob", " this is a test ", "irc_privmsg,irc_tag_batch=ref,irc_batch_type_example," "notify_message,prefix_nick_248,nick_bob," "host_user_b@host_b,log1"); @@ -1598,7 +1598,7 @@ TEST(IrcProtocolWithServer, batch_with_batch_cap) POINTERS_EQUAL(NULL, irc_batch_search (ptr_server, "ref")); /* start batch with parameters */ - RECV(":server BATCH +ref example param1 param2 param3"); + RECV(":server BATCH +ref example param1 param2 param3 "); CHECK_NO_MSG; ptr_batch = irc_batch_search (ptr_server, "ref"); CHECK(ptr_batch); @@ -1822,7 +1822,7 @@ TEST(IrcProtocolWithServer, cap) CHECK_ERROR_PARAMS("cap", 1, 2); /* CAP LS */ - RECV("CAP * LS :multi-prefix sasl"); + RECV("CAP * LS :multi-prefix sasl "); CHECK_SRV("--", "irc: client capability, server supports: multi-prefix sasl", "irc_cap,log3"); RECV("CAP * LS * :multi-prefix sasl"); @@ -1834,7 +1834,7 @@ TEST(IrcProtocolWithServer, cap) CHECK_NO_MSG; /* CAP LIST */ - RECV("CAP * LIST :multi-prefix sasl"); + RECV("CAP * LIST : multi-prefix sasl "); CHECK_SRV("--", "irc: client capability, currently enabled: multi-prefix sasl", "irc_cap,log3"); RECV("CAP * LIST * :multi-prefix sasl"); @@ -1846,30 +1846,30 @@ TEST(IrcProtocolWithServer, cap) CHECK_NO_MSG; /* CAP NEW */ - RECV("CAP * NEW :multi-prefix sasl"); - CHECK_SRV("--", "irc: client capability, now available: multi-prefix sasl", + RECV("CAP * NEW : multi-prefix sasl "); + CHECK_SRV("--", "irc: client capability, now available: multi-prefix sasl ", "irc_cap,log3"); RECV(":server CAP * NEW :multi-prefix sasl"); CHECK_SRV("--", "irc: client capability, now available: multi-prefix sasl", "irc_cap,log3"); /* CAP DEL */ - RECV("CAP * DEL :multi-prefix sasl"); - CHECK_SRV("--", "irc: client capability, removed: multi-prefix sasl", + RECV("CAP * DEL : multi-prefix sasl "); + CHECK_SRV("--", "irc: client capability, removed: multi-prefix sasl ", "irc_cap,log3"); RECV(":server CAP * DEL :multi-prefix sasl"); CHECK_SRV("--", "irc: client capability, removed: multi-prefix sasl", "irc_cap,log3"); /* CAP ACK */ - RECV("CAP * ACK :sasl"); + RECV("CAP * ACK : sasl "); CHECK_SRV("--", "irc: client capability, enabled: sasl", "irc_cap,log3"); RECV(":server CAP * ACK :sasl"); CHECK_SRV("--", "irc: client capability, enabled: sasl", "irc_cap,log3"); /* CAP NAK */ - RECV("CAP * NAK :sasl"); - CHECK_SRV("=!=", "irc: client capability, refused: sasl", "irc_cap,log3"); + RECV("CAP * NAK : sasl "); + CHECK_SRV("=!=", "irc: client capability, refused: sasl ", "irc_cap,log3"); RECV(":server CAP * NAK :sasl"); CHECK_SRV("=!=", "irc: client capability, refused: sasl", "irc_cap,log3"); } @@ -1905,7 +1905,7 @@ TEST(IrcProtocolWithServer, chghost) STRCMP_EQUAL("user_a@host_a", ptr_nick->host); /* self nick */ - RECV(":alice!user@host CHGHOST user2 host2"); + RECV(":alice!user@host CHGHOST user2 host2 "); CHECK_CHAN("--", "alice (user@host) has changed host to user2@host2", "irc_chghost,new_host_user2@host2,nick_alice,host_user@host,log3"); STRCMP_EQUAL("user2@host2", ptr_nick->host); @@ -1949,8 +1949,8 @@ TEST(IrcProtocolWithServer, error) RECV("ERROR test"); CHECK_SRV("=!=", "test", "irc_error,log3"); - RECV("ERROR :Closing Link: irc.server.org (Bad Password)"); - CHECK_SRV("=!=", "Closing Link: irc.server.org (Bad Password)", + RECV("ERROR : Closing Link: irc.server.org (Bad Password) "); + CHECK_SRV("=!=", " Closing Link: irc.server.org (Bad Password) ", "irc_error,log3"); } @@ -1973,8 +1973,8 @@ TEST(IrcProtocolWithServer, fail) RECV(":server FAIL * TEST"); CHECK_SRV("=!=", "Failure: [] TEST", "irc_fail,nick_server,log3"); - RECV(":server FAIL * TEST :the message"); - CHECK_SRV("=!=", "Failure: [TEST] the message", "irc_fail,nick_server,log3"); + RECV(":server FAIL * TEST : the message "); + CHECK_SRV("=!=", "Failure: [TEST] the message ", "irc_fail,nick_server,log3"); RECV(":server FAIL * TEST TEST2"); CHECK_SRV("=!=", "Failure: [TEST] TEST2", "irc_fail,nick_server,log3"); RECV(":server FAIL * TEST TEST2 :the message"); @@ -2012,7 +2012,7 @@ TEST(IrcProtocolWithServer, invite) RECV("INVITE alice #channel"); CHECK_ERROR_NICK("invite"); - RECV(":bob!user@host INVITE alice #channel"); + RECV(":bob!user@host INVITE alice #channel "); CHECK_SRV("--", "You have been invited to #channel by bob", "irc_invite,notify_highlight,nick_bob,host_user@host,log3"); RECV(":bob!user@host INVITE xxx #channel"); @@ -2048,7 +2048,7 @@ TEST(IrcProtocolWithServer, join) RECV(":bob!user@host JOIN #test"); CHECK_NO_MSG; - RECV(":alice!user@host JOIN #test"); + RECV(":alice!user@host JOIN #test "); CHECK_CHAN("-->", "alice (user@host) has joined #test", "irc_join,nick_alice,host_user@host,log4"); @@ -2088,8 +2088,8 @@ TEST(IrcProtocolWithServer, join) CHECK(ptr_channel->buffer); - RECV(":bob!user@host JOIN #test * :Bob Name"); - CHECK_CHAN("-->", "bob (Bob Name) (user@host) has joined #test", + RECV(":bob!user@host JOIN #test * : "); + CHECK_CHAN("-->", "bob ( ) (user@host) has joined #test", "irc_join,irc_smart_filter,nick_bob,host_user@host,log4"); ptr_nick = ptr_channel->last_nick; @@ -2102,12 +2102,12 @@ TEST(IrcProtocolWithServer, join) STRCMP_EQUAL(" ", ptr_nick->prefix); LONGS_EQUAL(0, ptr_nick->away); STRCMP_EQUAL(NULL, ptr_nick->account); - STRCMP_EQUAL("Bob Name", ptr_nick->realname); + STRCMP_EQUAL(" ", ptr_nick->realname); CHECK(ptr_nick->color); - RECV(":carol!user@host JOIN #test carol_account :Carol Name"); + RECV(":carol!user@host JOIN #test carol_account : Carol Name "); CHECK_CHAN("-->", - "carol [carol_account] (Carol Name) (user@host) " + "carol [carol_account] ( Carol Name ) (user@host) " "has joined #test", "irc_join,irc_smart_filter,nick_carol,host_user@host,log4"); @@ -2121,7 +2121,7 @@ TEST(IrcProtocolWithServer, join) STRCMP_EQUAL(" ", ptr_nick->prefix); LONGS_EQUAL(0, ptr_nick->away); STRCMP_EQUAL("carol_account", ptr_nick->account); - STRCMP_EQUAL("Carol Name", ptr_nick->realname); + STRCMP_EQUAL(" Carol Name ", ptr_nick->realname); CHECK(ptr_nick->color); /* join with option irc.look.display_host_join set to off */ @@ -2297,7 +2297,7 @@ TEST(IrcProtocolWithServer, mode) STRCMP_EQUAL(NULL, ptr_channel->modes); /* channel mode */ - RECV(":admin!user@host MODE #test +nt"); + RECV(":admin!user@host MODE #test +nt "); CHECK_CHAN("--", "Mode #test [+nt] by admin", "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("+tn", ptr_channel->modes); @@ -2315,7 +2315,7 @@ TEST(IrcProtocolWithServer, mode) STRCMP_EQUAL(NULL, ptr_channel->modes); /* nick mode '@' on channel #test */ - RECV(":admin!user@host MODE #test +o alice"); + RECV(":admin!user@host MODE #test +o alice "); CHECK_CHAN("--", "Mode #test [+o alice] by admin", "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("@ ", ptr_nick->prefixes); @@ -2399,7 +2399,7 @@ TEST(IrcProtocolWithServer, nick) CHECK_ERROR_NICK("nick"); /* new nick for alice */ - RECV(":alice!user@host NICK alice_away"); + RECV(":alice!user@host NICK alice_away "); CHECK_SRV("--", "You are now known as alice_away", "irc_nick,irc_nick1_alice,irc_nick2_alice_away," "nick_alice,host_user@host,log2"); @@ -2460,8 +2460,8 @@ TEST(IrcProtocolWithServer, note) RECV(":server NOTE * TEST"); CHECK_SRV("--", "Note: [] TEST", "irc_note,nick_server,log3"); - RECV(":server NOTE * TEST :the message"); - CHECK_SRV("--", "Note: [TEST] the message", "irc_note,nick_server,log3"); + RECV(":server NOTE * TEST : the message "); + CHECK_SRV("--", "Note: [TEST] the message ", "irc_note,nick_server,log3"); RECV(":server NOTE * TEST TEST2"); CHECK_SRV("--", "Note: [TEST] TEST2", "irc_note,nick_server,log3"); RECV(":server NOTE * TEST TEST2 :the message"); @@ -2799,9 +2799,9 @@ TEST(IrcProtocolWithServer, ping) CHECK_ERROR_PARAMS("ping", 0, 1); CHECK_SENT(NULL); - RECV("PING :123456789"); + RECV("PING :123456789 "); CHECK_NO_MSG; - CHECK_SENT("PONG :123456789"); + CHECK_SENT("PONG :123456789 "); } /* @@ -2817,8 +2817,8 @@ TEST(IrcProtocolWithServer, pong) CHECK_SRV("", "PONG", "irc_pong,nick_server,log3"); RECV(":server PONG server"); CHECK_SRV("", "PONG", "irc_pong,nick_server,log3"); - RECV(":server PONG server :info"); - CHECK_SRV("", "PONG: info", "irc_pong,nick_server,log3"); + RECV(":server PONG server : info "); + CHECK_SRV("", "PONG: info ", "irc_pong,nick_server,log3"); RECV(":server PONG server :extra info"); CHECK_SRV("", "PONG: extra info", "irc_pong,nick_server,log3"); } @@ -3555,17 +3555,17 @@ TEST(IrcProtocolWithServer, tagmsg) POINTERS_EQUAL(NULL, typing_status_nick_search (ptr_buffer, "bob")); - RECV("@+typing=active :bob!user@host TAGMSG #test"); + RECV("@+typing=active :bob!user@host TAGMSG #test "); ptr_typing_status = typing_status_nick_search (ptr_buffer, "bob"); CHECK(ptr_typing_status); LONGS_EQUAL(TYPING_STATUS_STATE_TYPING, ptr_typing_status->state); - RECV("@+typing=paused :bob!user@host TAGMSG :#test"); + RECV("@+typing=paused :bob!user@host TAGMSG : #test "); ptr_typing_status = typing_status_nick_search (ptr_buffer, "bob"); CHECK(ptr_typing_status); LONGS_EQUAL(TYPING_STATUS_STATE_PAUSED, ptr_typing_status->state); - RECV("@+typing=done :bob!user@host TAGMSG #test"); + RECV("@+typing=done :bob!user@host TAGMSG #test "); POINTERS_EQUAL(NULL, typing_status_nick_search (ptr_buffer, "bob")); config_file_option_reset (typing_config_look_enabled_nicks, 1); @@ -3683,8 +3683,8 @@ TEST(IrcProtocolWithServer, warn) RECV(":server WARN * TEST"); CHECK_SRV("=!=", "Warning: [] TEST", "irc_warn,nick_server,log3"); - RECV(":server WARN * TEST :the message"); - CHECK_SRV("=!=", "Warning: [TEST] the message", "irc_warn,nick_server,log3"); + RECV(":server WARN * TEST : the message "); + CHECK_SRV("=!=", "Warning: [TEST] the message ", "irc_warn,nick_server,log3"); RECV(":server WARN * TEST TEST2"); CHECK_SRV("=!=", "Warning: [TEST] TEST2", "irc_warn,nick_server,log3"); RECV(":server WARN * TEST TEST2 :the message"); @@ -3734,8 +3734,8 @@ TEST(IrcProtocolWithServer, 001_welcome) LONGS_EQUAL(0, ptr_server->is_connected); STRCMP_EQUAL("nick1", ptr_server->nick); - RECV(":server 001 alice :Welcome on this server, alice!"); - CHECK_SRV("--", "Welcome on this server, alice!", + RECV(":server 001 alice : Welcome on this server, alice! "); + CHECK_SRV("--", " Welcome on this server, alice! ", "irc_001,irc_numeric,nick_server,log3"); LONGS_EQUAL(1, ptr_server->is_connected); @@ -3786,8 +3786,8 @@ TEST(IrcProtocolWithServer, 005_full) LONGS_EQUAL(0, ptr_server->utf8only); STRCMP_EQUAL(NULL, ptr_server->isupport); - RECV(":server 005 alice " IRC_MSG_005 " :are supported"); - CHECK_SRV("--", IRC_MSG_005 " are supported", + RECV(":server 005 alice " IRC_MSG_005 " : are supported "); + CHECK_SRV("--", IRC_MSG_005 " are supported ", "irc_005,irc_numeric,nick_server,log3"); STRCMP_EQUAL("ohv", ptr_server->prefix_modes); @@ -3867,9 +3867,9 @@ TEST(IrcProtocolWithServer, 008) RECV(":server 008 alice"); CHECK_ERROR_PARAMS("008", 1, 2); - RECV(":server 008 alice +Zbfkrsuy :Server notice mask"); + RECV(":server 008 alice +Zbfkrsuy : Server notice mask "); CHECK_SRV("--", - "Server notice mask for alice: +Zbfkrsuy Server notice mask", + "Server notice mask for alice: +Zbfkrsuy Server notice mask ", "irc_008,irc_numeric,nick_server,log3"); } @@ -3890,8 +3890,8 @@ TEST(IrcProtocolWithServer, 221) STRCMP_EQUAL(NULL, ptr_server->nick_modes); - RECV(":server 221 alice :+abc"); - CHECK_SRV("--", "User mode for alice is [+abc]", + RECV(":server 221 alice : +abc "); + CHECK_SRV("--", "User mode for alice is [ +abc ]", "irc_221,irc_numeric,nick_server,log3"); STRCMP_EQUAL("abc", ptr_server->nick_modes); @@ -3998,71 +3998,73 @@ TEST(IrcProtocolWithServer, whois_nick_msg) CHECK_SRV("--", "[bob] UTF-8", "irc_223,irc_numeric,nick_server,log3"); RECV(":server 223 alice bob :UTF-8"); CHECK_SRV("--", "[bob] UTF-8", "irc_223,irc_numeric,nick_server,log3"); + RECV(":server 223 alice bob : UTF-8 "); + CHECK_SRV("--", "[bob] UTF-8 ", "irc_223,irc_numeric,nick_server,log3"); RECV(":server 223 alice bob"); CHECK_SRV("--", "bob", "irc_223,irc_numeric,nick_server,log3"); - RECV(":server 264 alice bob :is using encrypted connection"); - CHECK_SRV("--", "[bob] is using encrypted connection", + RECV(":server 264 alice bob : is using encrypted connection "); + CHECK_SRV("--", "[bob] is using encrypted connection ", "irc_264,irc_numeric,nick_server,log3"); RECV(":server 264 alice bob"); CHECK_SRV("--", "bob", "irc_264,irc_numeric,nick_server,log3"); - RECV(":server 275 alice bob :is using secure connection"); - CHECK_SRV("--", "[bob] is using secure connection", + RECV(":server 275 alice bob : is using secure connection "); + CHECK_SRV("--", "[bob] is using secure connection ", "irc_275,irc_numeric,nick_server,log3"); RECV(":server 275 alice bob"); CHECK_SRV("--", "bob", "irc_275,irc_numeric,nick_server,log3"); - RECV(":server 276 alice bob :has client certificate fingerprint"); - CHECK_SRV("--", "[bob] has client certificate fingerprint", + RECV(":server 276 alice bob : has client certificate fingerprint "); + CHECK_SRV("--", "[bob] has client certificate fingerprint ", "irc_276,irc_numeric,nick_server,log3"); RECV(":server 276 alice bob"); CHECK_SRV("--", "bob", "irc_276,irc_numeric,nick_server,log3"); - RECV(":server 307 alice bob :registered nick"); - CHECK_SRV("--", "[bob] registered nick", "irc_307,irc_numeric,nick_server,log3"); + RECV(":server 307 alice bob : registered nick "); + CHECK_SRV("--", "[bob] registered nick ", "irc_307,irc_numeric,nick_server,log3"); RECV(":server 307 alice bob"); CHECK_SRV("--", "bob", "irc_307,irc_numeric,nick_server,log3"); - RECV(":server 310 alice bob :help mode"); - CHECK_SRV("--", "[bob] help mode", "irc_310,irc_numeric,nick_server,log3"); + RECV(":server 310 alice bob : help mode "); + CHECK_SRV("--", "[bob] help mode ", "irc_310,irc_numeric,nick_server,log3"); RECV(":server 310 alice bob"); CHECK_SRV("--", "bob", "irc_310,irc_numeric,nick_server,log3"); - RECV(":server 313 alice bob :operator"); - CHECK_SRV("--", "[bob] operator", "irc_313,irc_numeric,nick_server,log3"); + RECV(":server 313 alice bob : operator "); + CHECK_SRV("--", "[bob] operator ", "irc_313,irc_numeric,nick_server,log3"); RECV(":server 313 alice bob"); CHECK_SRV("--", "bob", "irc_313,irc_numeric,nick_server,log3"); - RECV(":server 318 alice bob :end"); - CHECK_SRV("--", "[bob] end", "irc_318,irc_numeric,nick_server,log3"); + RECV(":server 318 alice bob : end "); + CHECK_SRV("--", "[bob] end ", "irc_318,irc_numeric,nick_server,log3"); RECV(":server 318 alice bob"); CHECK_SRV("--", "bob", "irc_318,irc_numeric,nick_server,log3"); - RECV(":server 319 alice bob :channels"); - CHECK_SRV("--", "[bob] channels", "irc_319,irc_numeric,nick_server,log3"); + RECV(":server 319 alice bob : channels "); + CHECK_SRV("--", "[bob] channels ", "irc_319,irc_numeric,nick_server,log3"); RECV(":server 319 alice bob"); CHECK_SRV("--", "bob", "irc_319,irc_numeric,nick_server,log3"); - RECV(":server 320 alice bob :identified user"); - CHECK_SRV("--", "[bob] identified user", "irc_320,irc_numeric,nick_server,log3"); + RECV(":server 320 alice bob : identified user "); + CHECK_SRV("--", "[bob] identified user ", "irc_320,irc_numeric,nick_server,log3"); RECV(":server 320 alice bob"); CHECK_SRV("--", "bob", "irc_320,irc_numeric,nick_server,log3"); - RECV(":server 326 alice bob :has oper privs"); - CHECK_SRV("--", "[bob] has oper privs", "irc_326,irc_numeric,nick_server,log3"); + RECV(":server 326 alice bob : has oper privs "); + CHECK_SRV("--", "[bob] has oper privs ", "irc_326,irc_numeric,nick_server,log3"); RECV(":server 326 alice bob"); CHECK_SRV("--", "bob", "irc_326,irc_numeric,nick_server,log3"); - RECV(":server 335 alice bob :is a bot"); - CHECK_SRV("--", "[bob] is a bot", "irc_335,irc_numeric,nick_server,log3"); + RECV(":server 335 alice bob : is a bot "); + CHECK_SRV("--", "[bob] is a bot ", "irc_335,irc_numeric,nick_server,log3"); RECV(":server 335 alice bob"); CHECK_SRV("--", "bob", "irc_335,irc_numeric,nick_server,log3"); - RECV(":server 337 alice bob :is hiding their idle time"); - CHECK_SRV("--", "[bob] is hiding their idle time", "irc_337,irc_numeric,nick_server,log3"); + RECV(":server 337 alice bob : is hiding their idle time "); + CHECK_SRV("--", "[bob] is hiding their idle time ", "irc_337,irc_numeric,nick_server,log3"); RECV(":server 337 alice bob"); CHECK_SRV("--", "bob", "irc_337,irc_numeric,nick_server,log3"); RECV(":server 378 alice bob"); CHECK_SRV("--", "bob", "irc_378,irc_numeric,nick_server,log3"); - RECV(":server 378 alice bob :connecting from"); - CHECK_SRV("--", "[bob] connecting from", "irc_378,irc_numeric,nick_server,log3"); + RECV(":server 378 alice bob : connecting from "); + CHECK_SRV("--", "[bob] connecting from ", "irc_378,irc_numeric,nick_server,log3"); RECV(":server 378 alice bob"); CHECK_SRV("--", "bob", "irc_378,irc_numeric,nick_server,log3"); - RECV(":server 379 alice bob :using modes"); - CHECK_SRV("--", "[bob] using modes", "irc_379,irc_numeric,nick_server,log3"); + RECV(":server 379 alice bob : using modes "); + CHECK_SRV("--", "[bob] using modes ", "irc_379,irc_numeric,nick_server,log3"); RECV(":server 379 alice bob"); CHECK_SRV("--", "bob", "irc_379,irc_numeric,nick_server,log3"); - RECV(":server 671 alice bob :secure connection"); - CHECK_SRV("--", "[bob] secure connection", "irc_671,irc_numeric,nick_server,log3"); + RECV(":server 671 alice bob : secure connection "); + CHECK_SRV("--", "[bob] secure connection ", "irc_671,irc_numeric,nick_server,log3"); RECV(":server 671 alice bob"); CHECK_SRV("--", "bob", "irc_671,irc_numeric,nick_server,log3"); } @@ -4087,8 +4089,8 @@ TEST(IrcProtocolWithServer, whowas_nick_msg) RECV(":server 369 alice bob end"); CHECK_SRV("--", "[bob] end", "irc_369,irc_numeric,nick_server,log3"); - RECV(":server 369 alice bob :end"); - CHECK_SRV("--", "[bob] end", "irc_369,irc_numeric,nick_server,log3"); + RECV(":server 369 alice bob : end "); + CHECK_SRV("--", "[bob] end ", "irc_369,irc_numeric,nick_server,log3"); RECV(":server 369 alice bob"); CHECK_SRV("--", "bob", "irc_369,irc_numeric,nick_server,log3"); } @@ -4138,8 +4140,8 @@ TEST(IrcProtocolWithServer, 303) RECV(":server 303 alice"); CHECK_ERROR_PARAMS("303", 1, 2); - RECV(":server 303 alice :nick1 nick2"); - CHECK_SRV("--", "Users online: nick1 nick2", + RECV(":server 303 alice : nick1 nick2 "); + CHECK_SRV("--", "Users online: nick1 nick2 ", "irc_303,irc_numeric,nick_server,log3"); } @@ -4174,12 +4176,12 @@ TEST(IrcProtocolWithServer, 305_306) CHECK_NO_MSG; LONGS_EQUAL(0, ptr_server->is_away); - RECV(":server 306 alice :We'll miss you"); /* now away */ - CHECK_SRV("--", "We'll miss you", "irc_306,irc_numeric,nick_server,log3"); + RECV(":server 306 alice : We'll miss you "); /* now away */ + CHECK_SRV("--", " We'll miss you ", "irc_306,irc_numeric,nick_server,log3"); LONGS_EQUAL(1, ptr_server->is_away); - RECV(":server 305 alice :Does this mean you're really back?"); - CHECK_SRV("--", "Does this mean you're really back?", + RECV(":server 305 alice : Does this mean you're really back? "); + CHECK_SRV("--", " Does this mean you're really back? ", "irc_305,irc_numeric,nick_server,log3"); LONGS_EQUAL(0, ptr_server->is_away); } @@ -4207,8 +4209,8 @@ TEST(IrcProtocolWithServer, 311) CHECK_SRV("--", "[bob] user", "irc_311,irc_numeric,nick_server,log3"); /* standard parameters */ - RECV(":server 311 alice bob user host * :real name"); - CHECK_SRV("--", "[bob] (user@host): real name", + RECV(":server 311 alice bob user host * : real name "); + CHECK_SRV("--", "[bob] (user@host): real name ", "irc_311,irc_numeric,nick_server,log3"); } @@ -4234,9 +4236,9 @@ TEST(IrcProtocolWithServer, 312) CHECK_SRV("--", "[bob] server", "irc_312,irc_numeric,nick_server,log3"); /* standard parameters */ - RECV(":server 312 alice bob server :https://example.com/"); - CHECK_SRV("--", "[bob] server (https://example.com/)", - "irc_312,irc_numeric,nick_server,log3"); + RECV(":server 312 alice bob server : https://example.com/ "); + CHECK_SRV("--", "[bob] server ( https://example.com/ )", + "irc_312,irc_numeric,nick_server,log3"); } /* @@ -4261,8 +4263,8 @@ TEST(IrcProtocolWithServer, 314) CHECK_SRV("--", "[bob] user", "irc_314,irc_numeric,nick_server,log3"); /* standard parameters */ - RECV(":server 314 alice bob user host * :real name"); - CHECK_SRV("--", "[bob] (user@host) was real name", + RECV(":server 314 alice bob user host * : real name "); + CHECK_SRV("--", "[bob] (user@host) was real name ", "irc_314,irc_numeric,nick_server,log3"); } @@ -4283,8 +4285,12 @@ TEST(IrcProtocolWithServer, 315) RECV(":server 315 alice #test"); CHECK_ERROR_PARAMS("315", 2, 3); - RECV(":server 315 alice #test End of /WHO list."); - CHECK_SRV("--", "[#test] End of /WHO list.", + RECV(":server 315 alice #test end"); + CHECK_SRV("--", "[#test] end", + "irc_315,irc_numeric,nick_server,log3"); + + RECV(":server 315 alice #test : End of /WHO list. "); + CHECK_SRV("--", "[#test] End of /WHO list. ", "irc_315,irc_numeric,nick_server,log3"); } @@ -4316,7 +4322,7 @@ TEST(IrcProtocolWithServer, 317) "[bob] idle: 1 day, 10 hours 07 minutes 57 seconds, " "signon at: Wed, 12 Mar 2008 13:18:00", "irc_317,irc_numeric,nick_server,log3"); - RECV(":server 317 alice bob 122877 1205327880 :seconds idle, signon time"); + RECV(":server 317 alice bob 122877 1205327880 :seconds idle, signon time "); CHECK_SRV("--", "[bob] idle: 1 day, 10 hours 07 minutes 57 seconds, " "signon at: Wed, 12 Mar 2008 13:18:00", @@ -4350,8 +4356,8 @@ TEST(IrcProtocolWithServer, 321) CHECK_SRV("--", "#test", "irc_321,irc_numeric,nick_server,log3"); RECV(":server 321 alice #test Users"); CHECK_SRV("--", "#test Users", "irc_321,irc_numeric,nick_server,log3"); - RECV(":server 321 alice #test :Users Name"); - CHECK_SRV("--", "#test Users Name", "irc_321,irc_numeric,nick_server,log3"); + RECV(":server 321 alice #test : Users Name "); + CHECK_SRV("--", "#test Users Name ", "irc_321,irc_numeric,nick_server,log3"); } /* @@ -4411,8 +4417,8 @@ TEST(IrcProtocolWithServer, 323) CHECK_SRV("--", "", "irc_323,irc_numeric,nick_server,log3"); RECV(":server 323 alice end"); CHECK_SRV("--", "end", "irc_323,irc_numeric,nick_server,log3"); - RECV(":server 323 alice :End of /LIST"); - CHECK_SRV("--", "End of /LIST", "irc_323,irc_numeric,nick_server,log3"); + RECV(":server 323 alice : End of /LIST "); + CHECK_SRV("--", " End of /LIST ", "irc_323,irc_numeric,nick_server,log3"); } /* @@ -4436,6 +4442,10 @@ TEST(IrcProtocolWithServer, 324) CHECK_NO_MSG; STRCMP_EQUAL("+nt", ptr_server->channels->modes); + RECV(":server 324 alice #test +nst "); + CHECK_CHAN("--", "Mode #test [+nst]", "irc_324,irc_numeric,nick_server,log3"); + STRCMP_EQUAL("+nst", ptr_server->channels->modes); + RECV(":server 324 alice #test"); CHECK_CHAN("--", "Mode #test []", "irc_324,irc_numeric,nick_server,log3"); STRCMP_EQUAL(NULL, ptr_server->channels->modes); @@ -4465,8 +4475,8 @@ TEST(IrcProtocolWithServer, 327) /* standard parameters */ RECV(":server 327 alice bob host 1.2.3.4"); CHECK_SRV("--", "[bob] host 1.2.3.4", "irc_327,irc_numeric,nick_server,log3"); - RECV(":server 327 alice bob host 1.2.3.4 :real name"); - CHECK_SRV("--", "[bob] host 1.2.3.4 (real name)", + RECV(":server 327 alice bob host 1.2.3.4 : real name "); + CHECK_SRV("--", "[bob] host 1.2.3.4 ( real name )", "irc_327,irc_numeric,nick_server,log3"); } @@ -4490,8 +4500,8 @@ TEST(IrcProtocolWithServer, 328) RECV(":server 328 alice #test :https://example.com/"); CHECK_CHAN("--", "URL for #test: https://example.com/", "irc_328,irc_numeric,nick_server,log3"); - RECV(":server 328 alice #test :URL is https://example.com/"); - CHECK_CHAN("--", "URL for #test: URL is https://example.com/", + RECV(":server 328 alice #test : URL is https://example.com/ "); + CHECK_CHAN("--", "URL for #test: URL is https://example.com/ ", "irc_328,irc_numeric,nick_server,log3"); } @@ -4523,7 +4533,7 @@ TEST(IrcProtocolWithServer, 329) RECV(":server 329 alice #xyz 1205327894"); CHECK_SRV("--", "Channel #xyz created on Wed, 12 Mar 2008 13:18:14", "irc_329,irc_numeric,nick_server,log3"); - RECV(":server 329 alice #xyz :1205327894"); + RECV(":server 329 alice #xyz :1205327894 "); CHECK_SRV("--", "Channel #xyz created on Wed, 12 Mar 2008 13:18:14", "irc_329,irc_numeric,nick_server,log3"); } @@ -4556,14 +4566,14 @@ TEST(IrcProtocolWithServer, 330_343) RECV(":server 330 alice bob bob2"); CHECK_SRV("--", "[bob] bob2", "irc_330,irc_numeric,nick_server,log3"); - RECV(":server 330 alice bob bob2 :is logged in as"); - CHECK_SRV("--", "[bob] is logged in as bob2", + RECV(":server 330 alice bob bob2 : is logged in as "); + CHECK_SRV("--", "[bob] is logged in as bob2", "irc_330,irc_numeric,nick_server,log3"); RECV(":server 343 alice bob bob2"); CHECK_SRV("--", "[bob] bob2", "irc_343,irc_numeric,nick_server,log3"); - RECV(":server 343 alice bob bob2 :is opered as"); - CHECK_SRV("--", "[bob] is opered as bob2", + RECV(":server 343 alice bob bob2 :is opered as "); + CHECK_SRV("--", "[bob] is opered as bob2", "irc_343,irc_numeric,nick_server,log3"); } @@ -4587,7 +4597,7 @@ TEST(IrcProtocolWithServer, 331) "irc_331,irc_numeric,nick_server,log3"); /* channel not found */ - RECV(":server 331 alice #xyz"); + RECV(":server 331 alice #xyz "); CHECK_SRV("--", "No topic set for channel #xyz", "irc_331,irc_numeric,nick_server,log3"); } @@ -4642,7 +4652,7 @@ TEST(IrcProtocolWithServer, 333) CHECK_CHAN("--", "Topic set by nick (user@host) on Thu, 13 Mar 2008 17:08:16", "irc_333,irc_numeric,nick_server,log3"); - RECV(":server 333 alice #test 1205428096"); + RECV(":server 333 alice #test 1205428096 "); CHECK_CHAN("--", "Topic set on Thu, 13 Mar 2008 17:08:16", "irc_333,irc_numeric,nick_server,log3"); @@ -4676,8 +4686,8 @@ TEST(IrcProtocolWithServer, 338) RECV(":server 338 alice bob"); CHECK_ERROR_PARAMS("338", 2, 3); - RECV(":server 338 alice bob hostname :actually using host"); - CHECK_SRV("--", "[bob] actually using host hostname", + RECV(":server 338 alice bob hostname : actually using host "); + CHECK_SRV("--", "[bob] actually using host hostname", "irc_338,irc_numeric,nick_server,log3"); /* on Rizon server */ @@ -4706,8 +4716,8 @@ TEST(IrcProtocolWithServer, 341) RECV(":server 341 alice bob #test"); CHECK_SRV("--", "alice has invited bob to #test", "irc_341,irc_numeric,nick_alice,log3"); - RECV(":server 341 alice bob :#test"); - CHECK_SRV("--", "alice has invited bob to #test", + RECV(":server 341 alice bob : #test "); + CHECK_SRV("--", "alice has invited bob to #test ", "irc_341,irc_numeric,nick_alice,log3"); } @@ -4732,26 +4742,26 @@ TEST(IrcProtocolWithServer, 344) RECV(":server 344 alice #test nick!user@host"); CHECK_SRV("--", "Channel reop #test: nick!user@host", "irc_344,irc_numeric,nick_server,log3"); - RECV(":server 344 alice #test :nick!user@host"); - CHECK_SRV("--", "Channel reop #test: nick!user@host", + RECV(":server 344 alice #test : nick!user@host "); + CHECK_SRV("--", "Channel reop #test: nick!user@host ", "irc_344,irc_numeric,nick_server,log3"); /* channel reop (IRCnet), channel not found */ RECV(":server 344 alice #xyz nick!user@host"); CHECK_SRV("--", "Channel reop #xyz: nick!user@host", "irc_344,irc_numeric,nick_server,log3"); - RECV(":server 344 alice #xyz :nick!user@host"); - CHECK_SRV("--", "Channel reop #xyz: nick!user@host", + RECV(":server 344 alice #xyz : nick!user@host "); + CHECK_SRV("--", "Channel reop #xyz: nick!user@host ", "irc_344,irc_numeric,nick_server,log3"); /* whois, geo info (UnrealIRCd) */ - RECV(":server 344 alice bob FR :is connecting from France"); - CHECK_SRV("--", "[bob] is connecting from France (FR)", + RECV(":server 344 alice bob FR : is connecting from France "); + CHECK_SRV("--", "[bob] is connecting from France (FR)", "irc_344,irc_numeric,nick_server,log3"); /* whois, geo info (UnrealIRCd), no country code */ - RECV(":server 344 alice bob :is connecting from France"); - CHECK_SRV("--", "[bob] is connecting from France", + RECV(":server 344 alice bob : is connecting from France "); + CHECK_SRV("--", "[bob] is connecting from France ", "irc_344,irc_numeric,nick_server,log3"); } @@ -4774,8 +4784,8 @@ TEST(IrcProtocolWithServer, 345) RECV(":server 345 alice #test end"); CHECK_SRV("--", "#test: end", "irc_345,irc_numeric,nick_server,log3"); - RECV(":server 345 alice #test :End of Channel Reop List"); - CHECK_SRV("--", "#test: End of Channel Reop List", + RECV(":server 345 alice #test : End of Channel Reop List "); + CHECK_SRV("--", "#test: End of Channel Reop List ", "irc_345,irc_numeric,nick_server,log3"); /* channel not found */ @@ -4809,7 +4819,7 @@ TEST(IrcProtocolWithServer, 346) RECV(":server 346 alice #test invitemask nick!user@host"); CHECK_CHAN("--", "[#test] [2] invitemask invited by nick (user@host)", "irc_346,irc_numeric,nick_server,log3"); - RECV(":server 346 alice #test invitemask nick!user@host 1205590879"); + RECV(":server 346 alice #test invitemask nick!user@host 1205590879 "); CHECK_CHAN("--", "[#test] [3] invitemask invited by nick (user@host) " "on Sat, 15 Mar 2008 14:21:19", @@ -4848,8 +4858,8 @@ TEST(IrcProtocolWithServer, 347) CHECK_CHAN("--", "[#test]", "irc_347,irc_numeric,nick_server,log3"); RECV(":server 347 alice #test end"); CHECK_CHAN("--", "[#test] end", "irc_347,irc_numeric,nick_server,log3"); - RECV(":server 347 alice #test :End of Channel Invite List"); - CHECK_CHAN("--", "[#test] End of Channel Invite List", + RECV(":server 347 alice #test : End of Channel Invite List "); + CHECK_CHAN("--", "[#test] End of Channel Invite List ", "irc_347,irc_numeric,nick_server,log3"); /* channel not found */ @@ -4888,7 +4898,7 @@ TEST(IrcProtocolWithServer, 348) "by nick2 (user2@host2)", "irc_348,irc_numeric,nick_server,log3"); RECV(":server 348 alice #test nick1!user1@host1 nick2!user2@host2 " - "1205585109"); + "1205585109 "); CHECK_CHAN("--", "[#test] [3] exception nick1!user1@host1 " "by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", @@ -4930,8 +4940,8 @@ TEST(IrcProtocolWithServer, 349) CHECK_CHAN("--", "[#test]", "irc_349,irc_numeric,nick_server,log3"); RECV(":server 349 alice #test end"); CHECK_CHAN("--", "[#test] end", "irc_349,irc_numeric,nick_server,log3"); - RECV(":server 349 alice #test :End of Channel Exception List"); - CHECK_CHAN("--", "[#test] End of Channel Exception List", + RECV(":server 349 alice #test :End of Channel Exception List "); + CHECK_CHAN("--", "[#test] End of Channel Exception List ", "irc_349,irc_numeric,nick_server,log3"); /* channel not found */ @@ -4960,11 +4970,11 @@ TEST(IrcProtocolWithServer, 350) CHECK_ERROR_PARAMS("350", 1, 2); /* non-standard parameters (using whois_nick_msg callback) */ - RECV(":server 350 alice bob :something here"); - CHECK_SRV("--", "[bob] something here", + RECV(":server 350 alice bob : something here "); + CHECK_SRV("--", "[bob] something here ", "irc_350,irc_numeric,nick_server,log3"); - RECV(":server 350 alice bob * :something here"); - CHECK_SRV("--", "[bob] something here", + RECV(":server 350 alice bob * : something here "); + CHECK_SRV("--", "[bob] something here ", "irc_350,irc_numeric,nick_server,log3"); /* non-standard parameters (using default whois callback) */ @@ -4972,8 +4982,8 @@ TEST(IrcProtocolWithServer, 350) CHECK_SRV("--", "bob", "irc_350,irc_numeric,nick_server,log3"); /* standard parameters */ - RECV(":server 350 alice bob * * :is connected via the WebIRC gateway"); - CHECK_SRV("--", "[bob] is connected via the WebIRC gateway", + RECV(":server 350 alice bob * * : is connected via the WebIRC gateway "); + CHECK_SRV("--", "[bob] is connected via the WebIRC gateway ", "irc_350,irc_numeric,nick_server,log3"); RECV(":server 350 alice bob example.com * :is connected via the WebIRC gateway"); CHECK_SRV("--", "[bob] (example.com) is connected via the WebIRC gateway", @@ -5007,8 +5017,8 @@ TEST(IrcProtocolWithServer, 351) RECV(":server 351 alice dancer-ircd-1.0 server"); CHECK_SRV("--", "dancer-ircd-1.0 server", "irc_351,irc_numeric,nick_server,log3"); - RECV(":server 351 alice dancer-ircd-1.0 server :iMZ dncrTS/v4"); - CHECK_SRV("--", "dancer-ircd-1.0 server (iMZ dncrTS/v4)", + RECV(":server 351 alice dancer-ircd-1.0 server : iMZ dncrTS/v4 "); + CHECK_SRV("--", "dancer-ircd-1.0 server ( iMZ dncrTS/v4 )", "irc_351,irc_numeric,nick_server,log3"); } @@ -5063,12 +5073,12 @@ TEST(IrcProtocolWithServer, 352) LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL(NULL, ptr_nick2->realname); - RECV(":server 352 alice #test user4 host4 server bob * :0 real name 1"); - CHECK_SRV("--", "[#test] bob (user4@host4) * 0 (real name 1)", + RECV(":server 352 alice #test user4 host4 server bob * :0 real name 1 "); + CHECK_SRV("--", "[#test] bob (user4@host4) * 0 (real name 1 )", "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user4@host4", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); - STRCMP_EQUAL("real name 1", ptr_nick2->realname); + STRCMP_EQUAL("real name 1 ", ptr_nick2->realname); RECV(":server 352 alice #test user5 host5 server bob H@ :0 real name 2"); CHECK_SRV("--", "[#test] bob (user5@host5) H@ 0 (real name 2)", @@ -5169,7 +5179,7 @@ TEST(IrcProtocolWithServer, 353) STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name); POINTERS_EQUAL(NULL, ptr_channel->nicks->next_nick->next_nick); - RECV(":server 353 alice #test :alice bob @carol +dan!user@host"); + RECV(":server 353 alice #test :alice bob @carol +dan!user@host "); CHECK_NO_MSG; STRCMP_EQUAL("alice", ptr_channel->nicks->name); STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name); @@ -5338,13 +5348,13 @@ TEST(IrcProtocolWithServer, 354) STRCMP_EQUAL(NULL, ptr_nick2->realname); RECV(":server 354 alice #test user3 host3 server bob * 0 account3 " - ":real name 2"); - CHECK_SRV("--", "[#test] bob [account3] (user3@host3) * 0 (real name 2)", + ": real name 2 "); + CHECK_SRV("--", "[#test] bob [account3] (user3@host3) * 0 ( real name 2 )", "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user3@host3", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("account3", ptr_nick2->account); - STRCMP_EQUAL("real name 2", ptr_nick2->realname); + STRCMP_EQUAL(" real name 2 ", ptr_nick2->realname); RECV(":server 354 alice #test user4 host4 server bob H@ 0 account4 " ":real name 3"); @@ -5444,7 +5454,7 @@ TEST(IrcProtocolWithServer, 366) RECV(":server 366 alice #test end"); CHECK_CHAN("--", "Channel #test: 1 nick (0 ops, 0 voiced, 1 regular)", "irc_366,irc_numeric,nick_server,log3"); - RECV(":server 366 alice #test :End of /NAMES list"); + RECV(":server 366 alice #test : End of /NAMES list "); CHECK_CHAN("--", "Channel #test: 1 nick (0 ops, 0 voiced, 1 regular)", "irc_366,irc_numeric,nick_server,log3"); @@ -5541,8 +5551,8 @@ TEST(IrcProtocolWithServer, 366) /* channel not found */ RECV(":server 366 alice #xyz end"); CHECK_SRV("--", "#xyz: end", "irc_366,irc_numeric,nick_server,log3"); - RECV(":server 366 alice #xyz :End of /NAMES list"); - CHECK_SRV("--", "#xyz: End of /NAMES list", + RECV(":server 366 alice #xyz : End of /NAMES list "); + CHECK_SRV("--", "#xyz: End of /NAMES list ", "irc_366,irc_numeric,nick_server,log3"); } @@ -5566,12 +5576,12 @@ TEST(IrcProtocolWithServer, 367) RECV(":server 367 alice #test nick1!user1@host1"); CHECK_CHAN("--", "[#test] [1] nick1!user1@host1 banned", "irc_367,irc_numeric,nick_server,log3"); - RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2"); + RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2 "); CHECK_CHAN("--", "[#test] [2] nick1!user1@host1 banned by nick2 (user2@host2)", "irc_367,irc_numeric,nick_server,log3"); RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2 " - "1205585109"); + "1205585109 "); CHECK_CHAN("--", "[#test] [3] nick1!user1@host1 banned " "by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", @@ -5610,8 +5620,8 @@ TEST(IrcProtocolWithServer, 368) CHECK_CHAN("--", "[#test]", "irc_368,irc_numeric,nick_server,log3"); RECV(":server 368 alice #test end"); CHECK_CHAN("--", "[#test] end", "irc_368,irc_numeric,nick_server,log3"); - RECV(":server 368 alice #test :End of Channel Ban List"); - CHECK_CHAN("--", "[#test] End of Channel Ban List", + RECV(":server 368 alice #test : End of Channel Ban List "); + CHECK_CHAN("--", "[#test] End of Channel Ban List ", "irc_368,irc_numeric,nick_server,log3"); /* channel not found */ @@ -5641,8 +5651,8 @@ TEST(IrcProtocolWithServer, 401) RECV(":server 401 alice bob"); CHECK_SRV("--", "bob", "irc_401,irc_numeric,nick_server,log3"); - RECV(":server 401 alice bob :No such nick/channel"); - CHECK_SRV("--", "bob: No such nick/channel", + RECV(":server 401 alice bob : No such nick/channel "); + CHECK_SRV("--", "bob: No such nick/channel ", "irc_401,irc_numeric,nick_server,log3"); RECV(":server 401 alice #unknown :No such nick/channel"); @@ -5667,8 +5677,8 @@ TEST(IrcProtocolWithServer, 402) RECV(":server 402 alice server"); CHECK_SRV("--", "server", "irc_402,irc_numeric,nick_server,log3"); - RECV(":server 402 alice server :No such server"); - CHECK_SRV("--", "server: No such server", + RECV(":server 402 alice server : No such server "); + CHECK_SRV("--", "server: No such server ", "irc_402,irc_numeric,nick_server,log3"); } @@ -5689,8 +5699,8 @@ TEST(IrcProtocolWithServer, 404) RECV(":server 404 alice #test"); CHECK_SRV("--", "#test", "irc_404,irc_numeric,nick_server,log3"); - RECV(":server 404 alice #test :Cannot send to channel"); - CHECK_CHAN("--", "#test: Cannot send to channel", + RECV(":server 404 alice #test : Cannot send to channel "); + CHECK_CHAN("--", "#test: Cannot send to channel ", "irc_404,irc_numeric,nick_server,log3"); RECV(":server 404 alice #test2 :Cannot send to channel"); CHECK_SRV("--", "#test2: Cannot send to channel", @@ -5714,8 +5724,8 @@ TEST(IrcProtocolWithServer, 415) RECV(":server 415 alice #test"); CHECK_SRV("--", "#test", "irc_415,irc_numeric,nick_server,log3"); - RECV(":server 415 alice #test :Cannot send message to channel (+R)"); - CHECK_CHAN("--", "#test: Cannot send message to channel (+R)", + RECV(":server 415 alice #test : Cannot send message to channel (+R) "); + CHECK_CHAN("--", "#test: Cannot send message to channel (+R) ", "irc_415,irc_numeric,nick_server,log3"); RECV(":server 415 alice #test2 :Cannot send message to channel (+R)"); CHECK_SRV("--", "#test2: Cannot send message to channel (+R)", @@ -5741,8 +5751,8 @@ TEST(IrcProtocolWithServer, 432_not_connected) "irc: nickname \"nick2\" is invalid, trying nickname \"nick3\"", ""); - RECV(":server 432 * alice :Erroneous Nickname"); - CHECK_SRV("--", "* alice Erroneous Nickname", ""); + RECV(":server 432 * alice : Erroneous Nickname "); + CHECK_SRV("--", "* alice Erroneous Nickname ", ""); CHECK_SRV("=!=", "irc: nickname \"nick3\" is invalid, trying nickname \"nick1_\"", ""); @@ -5774,16 +5784,16 @@ TEST(IrcProtocolWithServer, 432_connected) CHECK_SRV("--", "test%+", "irc_432,irc_numeric,nick_server,log3"); RECV(":server 432 alice test%+ error"); CHECK_SRV("--", "test%+: error", "irc_432,irc_numeric,nick_server,log3"); - RECV(":server 432 alice test%+ :Erroneous Nickname"); - CHECK_SRV("--", "test%+: Erroneous Nickname", + RECV(":server 432 alice test%+ : Erroneous Nickname "); + CHECK_SRV("--", "test%+: Erroneous Nickname ", "irc_432,irc_numeric,nick_server,log3"); /* * special case: erroneous nick is a channel: check that the message is * still displayed on the server buffer */ - RECV(":server 432 alice #test :Erroneous Nickname"); - CHECK_SRV("--", "#test: Erroneous Nickname", + RECV(":server 432 alice #test : Erroneous Nickname "); + CHECK_SRV("--", "#test: Erroneous Nickname ", "irc_432,irc_numeric,nick_server,log3"); } @@ -5800,7 +5810,7 @@ TEST(IrcProtocolWithServer, 433_not_connected) "trying nickname \"nick2\"", ""); - RECV(":server 433 * alice :Nickname is already in use."); + RECV(":server 433 * alice : Nickname is already in use. "); CHECK_SRV("--", "irc: nickname \"nick2\" is already in use, " "trying nickname \"nick3\"", @@ -5832,8 +5842,8 @@ TEST(IrcProtocolWithServer, 433_connected) CHECK_SRV("--", "test", "irc_433,irc_numeric,nick_server,log3"); RECV(":server 433 alice test error"); CHECK_SRV("--", "test: error", "irc_433,irc_numeric,nick_server,log3"); - RECV(":server 433 alice test :Nickname is already in use."); - CHECK_SRV("--", "test: Nickname is already in use.", + RECV(":server 433 alice test : Nickname is already in use. "); + CHECK_SRV("--", "test: Nickname is already in use. ", "irc_433,irc_numeric,nick_server,log3"); /* @@ -5841,8 +5851,8 @@ TEST(IrcProtocolWithServer, 433_connected) * never happen in practice): check that the message is still displayed * on the server buffer */ - RECV(":server 433 alice #test :Nickname is already in use."); - CHECK_SRV("--", "#test: Nickname is already in use.", + RECV(":server 433 alice #test : Nickname is already in use. "); + CHECK_SRV("--", "#test: Nickname is already in use. ", "irc_433,irc_numeric,nick_server,log3"); } @@ -5855,8 +5865,8 @@ TEST(IrcProtocolWithServer, 437_not_connected) { RECV(":server 437 * alice error"); CHECK_SRV("--", "* alice error", "irc_437,irc_numeric,nick_server,log3"); - RECV(":server 437 * alice :Nick/channel is temporarily unavailable"); - CHECK_SRV("--", "* alice Nick/channel is temporarily unavailable", + RECV(":server 437 * alice : Nick/channel is temporarily unavailable "); + CHECK_SRV("--", "* alice Nick/channel is temporarily unavailable ", "irc_437,irc_numeric,nick_server,log3"); RECV(":server 437 * alice1 :Nick/channel is temporarily unavailable"); CHECK_SRV("--", "* alice1 Nick/channel is temporarily unavailable", @@ -5882,8 +5892,8 @@ TEST(IrcProtocolWithServer, 437_connected) CHECK_SRV("--", "* alice", "irc_437,irc_numeric,nick_server,log3"); RECV(":server 437 * alice error"); CHECK_SRV("--", "* alice error", "irc_437,irc_numeric,nick_server,log3"); - RECV(":server 437 * alice :Nick/channel is temporarily unavailable"); - CHECK_SRV("--", "* alice Nick/channel is temporarily unavailable", + RECV(":server 437 * alice : Nick/channel is temporarily unavailable "); + CHECK_SRV("--", "* alice Nick/channel is temporarily unavailable ", "irc_437,irc_numeric,nick_server,log3"); RECV(":server 437 alice #test :Cannot change nickname while banned on channel"); CHECK_SRV("--", "#test: Cannot change nickname while banned on channel", @@ -5910,10 +5920,10 @@ TEST(IrcProtocolWithServer, 438) RECV(":server 438 alice alice2 error"); CHECK_SRV("--", "error (alice => alice2)", "irc_438,irc_numeric,nick_server,log3"); - RECV(":server 438 alice alice2 :Nick change too fast. " - "Please wait 30 seconds."); + RECV(":server 438 alice alice2 : Nick change too fast. " + "Please wait 30 seconds. "); CHECK_SRV("--", - "Nick change too fast. Please wait 30 seconds. (alice => alice2)", + " Nick change too fast. Please wait 30 seconds. (alice => alice2)", "irc_438,irc_numeric,nick_server,log3"); } @@ -5939,8 +5949,8 @@ TEST(IrcProtocolWithServer, 470) RECV(":server 470 alice #test #test2 forwarding"); CHECK_SRV("--", "#test: #test2 forwarding", "irc_470,irc_numeric,nick_server,log3"); - RECV(":server 470 alice #test #test2 :Forwarding to another channel"); - CHECK_SRV("--", "#test: #test2 Forwarding to another channel", + RECV(":server 470 alice #test #test2 : Forwarding to another channel "); + CHECK_SRV("--", "#test: #test2 Forwarding to another channel ", "irc_470,irc_numeric,nick_server,log3"); } @@ -5960,10 +5970,10 @@ TEST(IrcProtocolWithServer, 524) CHECK_ERROR_PARAMS("524", 1, 2); RECV(":server 524 alice UNKNOWN"); - CHECK_SRV("--", "", "irc_524,irc_numeric,notify_private,nick_server,log3"); - RECV(":server 524 alice UNKNOWN :Help not found"); - CHECK_SRV("--", "Help not found", - "irc_524,irc_numeric,notify_private,nick_server,log3"); + CHECK_SRV("--", "UNKNOWN", "irc_524,irc_numeric,nick_server,log3"); + RECV(":server 524 alice UNKNOWN : Help not found "); + CHECK_SRV("--", "UNKNOWN: Help not found ", + "irc_524,irc_numeric,nick_server,log3"); } /* @@ -5982,8 +5992,8 @@ TEST(IrcProtocolWithServer, 569) CHECK_ERROR_PARAMS("569", 1, 2); /* whois, connecting from (UnrealIRCd) */ - RECV(":server 569 alice bob 12345 :is connecting from AS12345 [Hoster]"); - CHECK_SRV("--", "[bob] is connecting from AS12345 [Hoster] (12345)", + RECV(":server 569 alice bob 12345 : is connecting from AS12345 [Hoster] "); + CHECK_SRV("--", "[bob] is connecting from AS12345 [Hoster] (12345)", "irc_569,irc_numeric,nick_server,log3"); /* whois, connecting from (UnrealIRCd), no ASN */ @@ -6008,11 +6018,11 @@ TEST(IrcProtocolWithServer, 704) CHECK_ERROR_PARAMS("704", 1, 2); RECV(":server 704 alice MODE"); - CHECK_SRV("--", "", "irc_704,irc_numeric,notify_private,nick_server,log3"); + CHECK_SRV("--", "MODE", "irc_704,irc_numeric,nick_server,log3"); RECV(":server 704 alice MODE " - ":MODE [ [...]]"); - CHECK_SRV("--", "MODE [ [...]]", - "irc_704,irc_numeric,notify_private,nick_server,log3"); + ": MODE [ [...]] "); + CHECK_SRV("--", "MODE: MODE [ [...]] ", + "irc_704,irc_numeric,nick_server,log3"); } /* @@ -6031,10 +6041,10 @@ TEST(IrcProtocolWithServer, 705) CHECK_ERROR_PARAMS("705", 1, 2); RECV(":server 705 alice MODE"); - CHECK_SRV("--", "", "irc_705,irc_numeric,notify_private,nick_server,log3"); - RECV(":server 705 alice MODE :Sets and removes modes from the given target."); - CHECK_SRV("--", "Sets and removes modes from the given target.", - "irc_705,irc_numeric,notify_private,nick_server,log3"); + CHECK_SRV("--", "MODE", "irc_705,irc_numeric,nick_server,log3"); + RECV(":server 705 alice MODE : Sets and removes modes from the given target. "); + CHECK_SRV("--", "MODE: Sets and removes modes from the given target. ", + "irc_705,irc_numeric,nick_server,log3"); } /* @@ -6053,11 +6063,10 @@ TEST(IrcProtocolWithServer, 706) CHECK_ERROR_PARAMS("706", 1, 2); RECV(":server 706 alice MODE"); - CHECK_SRV("--", "", - "irc_706,irc_numeric,notify_private,nick_server,log3"); - RECV(":server 706 alice MODE :End of /HELPOP"); - CHECK_SRV("--", "End of /HELPOP", - "irc_706,irc_numeric,notify_private,nick_server,log3"); + CHECK_SRV("--", "MODE", "irc_706,irc_numeric,nick_server,log3"); + RECV(":server 706 alice MODE : End of /HELPOP "); + CHECK_SRV("--", "MODE: End of /HELPOP ", + "irc_706,irc_numeric,nick_server,log3"); } /* @@ -6080,15 +6089,15 @@ TEST(IrcProtocolWithServer, 710) RECV(":server 710 #test #test nick1!user1@host1"); CHECK_CHAN("--", "nick1 (user1@host1) has asked for an invite", "irc_710,irc_numeric,notify_message,nick_nick1,host_user1@host1,log3"); - RECV(":server 710 #test #test nick1!user1@host1 :has asked for an invite."); - CHECK_CHAN("--", "nick1 (user1@host1) has asked for an invite.", + RECV(":server 710 #test #test nick1!user1@host1 : has asked for an invite. "); + CHECK_CHAN("--", "nick1 (user1@host1) has asked for an invite. ", "irc_710,irc_numeric,notify_message,nick_nick1,host_user1@host1,log3"); /* channel not found */ RECV(":server 710 #xyz #xyz nick1!user1@host1"); CHECK_ERROR_PARSE("710", ":server 710 #xyz #xyz nick1!user1@host1"); - RECV(":server 710 #xyz #xyz nick1!user1@host1 :has asked for an invite."); - CHECK_ERROR_PARSE("710", ":server 710 #xyz #xyz nick1!user1@host1 :has asked for an invite."); + RECV(":server 710 #xyz #xyz nick1!user1@host1 : has asked for an invite. "); + CHECK_ERROR_PARSE("710", ":server 710 #xyz #xyz nick1!user1@host1 : has asked for an invite. "); } /* @@ -6108,8 +6117,8 @@ TEST(IrcProtocolWithServer, 711) RECV(":server 711 alice #test"); CHECK_ERROR_PARAMS("711", 2, 3); - RECV(":server 711 alice #test :Your KNOCK has been delivered."); - CHECK_SRV("--", "#test: Your KNOCK has been delivered.", + RECV(":server 711 alice #test : Your KNOCK has been delivered. "); + CHECK_SRV("--", "#test: Your KNOCK has been delivered. ", "irc_711,irc_numeric,nick_server,log3"); } @@ -6130,8 +6139,8 @@ TEST(IrcProtocolWithServer, 712) RECV(":server 712 alice #test"); CHECK_ERROR_PARAMS("712", 2, 3); - RECV(":server 712 alice #test :Too many KNOCKs (channel)."); - CHECK_SRV("--", "#test: Too many KNOCKs (channel).", + RECV(":server 712 alice #test : Too many KNOCKs (channel). "); + CHECK_SRV("--", "#test: Too many KNOCKs (channel). ", "irc_712,irc_numeric,nick_server,log3"); } @@ -6152,8 +6161,8 @@ TEST(IrcProtocolWithServer, 713) RECV(":server 713 alice #test"); CHECK_ERROR_PARAMS("713", 2, 3); - RECV(":server 713 alice #test :Channel is open."); - CHECK_SRV("--", "#test: Channel is open.", + RECV(":server 713 alice #test : Channel is open. "); + CHECK_SRV("--", "#test: Channel is open. ", "irc_713,irc_numeric,nick_server,log3"); } @@ -6174,8 +6183,8 @@ TEST(IrcProtocolWithServer, 714) RECV(":server 714 alice #test"); CHECK_ERROR_PARAMS("714", 2, 3); - RECV(":server 714 alice #test :You are already on that channel."); - CHECK_SRV("--", "#test: You are already on that channel.", + RECV(":server 714 alice #test : You are already on that channel. "); + CHECK_SRV("--", "#test: You are already on that channel. ", "irc_714,irc_numeric,nick_server,log3"); } @@ -6194,21 +6203,21 @@ TEST(IrcProtocolWithServer, 716) RECV(":server 716 alice"); CHECK_ERROR_PARAMS("716", 1, 2); - RECV(":server 716 alice bob :is in +g mode and must manually allow you to " - "message them. Your message was discarded."); + RECV(":server 716 alice bob : is in +g mode and must manually allow you to " + "message them. Your message was discarded. "); CHECK_SRV("--", - "bob: is in +g mode and must manually allow you to message them. " - "Your message was discarded.", + "bob: is in +g mode and must manually allow you to message them. " + "Your message was discarded. ", "irc_716,irc_numeric,nick_server,log3"); /* open private buffer */ RECV(":bob!user@host PRIVMSG alice :hi Alice!"); - RECV(":server 716 alice bob :is in +g mode and must manually allow you to " - "message them. Your message was discarded."); + RECV(":server 716 alice bob : is in +g mode and must manually allow you to " + "message them. Your message was discarded. "); CHECK_PV("bob", "--", - "bob: is in +g mode and must manually allow you to message them. " - "Your message was discarded.", + "bob: is in +g mode and must manually allow you to message them. " + "Your message was discarded. ", "irc_716,irc_numeric,nick_server,log3"); } @@ -6227,15 +6236,15 @@ TEST(IrcProtocolWithServer, 717) RECV(":server 717 alice"); CHECK_ERROR_PARAMS("717", 1, 2); - RECV(":server 717 alice bob :has been informed that you messaged them."); - CHECK_SRV("--", "bob: has been informed that you messaged them.", + RECV(":server 717 alice bob : has been informed that you messaged them. "); + CHECK_SRV("--", "bob: has been informed that you messaged them. ", "irc_717,irc_numeric,nick_server,log3"); /* open private buffer */ RECV(":bob!user@host PRIVMSG alice :hi Alice!"); - RECV(":server 717 alice bob :has been informed that you messaged them."); + RECV(":server 717 alice bob : has been informed that you messaged them. "); CHECK_PV("bob", "--", - "bob: has been informed that you messaged them.", + "bob: has been informed that you messaged them. ", "irc_717,irc_numeric,nick_server,log3"); } @@ -6265,7 +6274,7 @@ TEST(IrcProtocolWithServer, 728) CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted by alice (user@host)", "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #test q nick1!user1@host1 alice!user@host " - "1351350090"); + "1351350090 "); CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted by alice (user@host) " "on Sat, 27 Oct 2012 15:01:30", @@ -6279,7 +6288,7 @@ TEST(IrcProtocolWithServer, 728) CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host)", "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #xyz q nick1!user1@host1 alice!user@host " - "1351350090"); + "1351350090 "); CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host) " "on Sat, 27 Oct 2012 15:01:30", "irc_728,irc_numeric,nick_server,log3"); @@ -6306,8 +6315,8 @@ TEST(IrcProtocolWithServer, 729) CHECK_CHAN("--", "[#test]", "irc_729,irc_numeric,nick_server,log3"); RECV(":server 729 alice #test q end"); CHECK_CHAN("--", "[#test] end", "irc_729,irc_numeric,nick_server,log3"); - RECV(":server 729 alice #test q :End of Channel Quiet List"); - CHECK_CHAN("--", "[#test] End of Channel Quiet List", + RECV(":server 729 alice #test q : End of Channel Quiet List "); + CHECK_CHAN("--", "[#test] End of Channel Quiet List ", "irc_729,irc_numeric,nick_server,log3"); /* channel not found */ @@ -6315,8 +6324,8 @@ TEST(IrcProtocolWithServer, 729) CHECK_SRV("--", "[#xyz]", "irc_729,irc_numeric,nick_server,log3"); RECV(":server 729 alice #xyz q end"); CHECK_SRV("--", "[#xyz] end", "irc_729,irc_numeric,nick_server,log3"); - RECV(":server 729 alice #xyz q :End of Channel Quiet List"); - CHECK_SRV("--", "[#xyz] End of Channel Quiet List", + RECV(":server 729 alice #xyz q : End of Channel Quiet List "); + CHECK_SRV("--", "[#xyz] End of Channel Quiet List ", "irc_729,irc_numeric,nick_server,log3"); } @@ -6341,7 +6350,7 @@ TEST(IrcProtocolWithServer, 730) CHECK_ERROR_PARAMS("731", 1, 2); /* without notify */ - RECV(":server 730 alice :nick1!user1@host1,nick2!user2@host2"); + RECV(":server 730 alice : nick1!user1@host1,nick2!user2@host2 "); CHECK_SRV("--", "notify: nick1 (user1@host1) is connected", "irc_notify,irc_notify_join,nick_nick1,notify_message,log3"); CHECK_SRV("--", "notify: nick2 (user2@host2) is connected", @@ -6352,7 +6361,7 @@ TEST(IrcProtocolWithServer, 730) CHECK_SRV("--", "notify: nick2 (user2@host2) is connected", "irc_notify,irc_notify_join,nick_nick2,notify_message,log3"); - RECV(":server 731 alice :nick1!user1@host1,nick2!user2@host2"); + RECV(":server 731 alice : nick1!user1@host1,nick2!user2@host2 "); CHECK_SRV("--", "notify: nick1 (user1@host1) is offline", "irc_notify,irc_notify_quit,nick_nick1,notify_message,log3"); CHECK_SRV("--", "notify: nick2 (user2@host2) is offline", @@ -6366,7 +6375,7 @@ TEST(IrcProtocolWithServer, 730) /* with notify on nick1 */ run_cmd_quiet ("/notify add nick1 " IRC_FAKE_SERVER); - RECV(":server 730 alice :nick1!user1@host1,nick2!user2@host2"); + RECV(":server 730 alice : nick1!user1@host1,nick2!user2@host2 "); CHECK_SRV("--", "notify: nick1 (user1@host1) is connected", "irc_notify,irc_notify_join,nick_nick1,notify_message,log3"); CHECK_SRV("--", "notify: nick2 (user2@host2) is connected", @@ -6375,7 +6384,7 @@ TEST(IrcProtocolWithServer, 730) CHECK_SRV("--", "notify: nick2 (user2@host2) is connected", "irc_notify,irc_notify_join,nick_nick2,notify_message,log3"); - RECV(":server 731 alice :nick1!user1@host1,nick2!user2@host2"); + RECV(":server 731 alice : nick1!user1@host1,nick2!user2@host2 "); CHECK_SRV("--", "notify: nick1 (user1@host1) has quit", "irc_notify,irc_notify_quit,nick_nick1,notify_message,log3"); CHECK_SRV("--", "notify: nick2 (user2@host2) is offline", @@ -6433,7 +6442,7 @@ TEST(IrcProtocolWithServer, 732) RECV(":server 732 alice"); CHECK_SRV("--", "", "irc_732,irc_numeric,nick_server,log3"); - RECV(":server 732 alice :nick1!user1@host1,nick2!user2@host2"); + RECV(":server 732 alice : nick1!user1@host1,nick2!user2@host2 "); CHECK_SRV("--", "nick1!user1@host1,nick2!user2@host2", "irc_732,irc_numeric,nick_server,log3"); } @@ -6455,8 +6464,8 @@ TEST(IrcProtocolWithServer, 733) CHECK_SRV("--", "", "irc_733,irc_numeric,nick_server,log3"); RECV(":server 733 alice end"); CHECK_SRV("--", "end", "irc_733,irc_numeric,nick_server,log3"); - RECV(":server 733 alice :End of MONITOR list"); - CHECK_SRV("--", "End of MONITOR list", "irc_733,irc_numeric,nick_server,log3"); + RECV(":server 733 alice : End of MONITOR list "); + CHECK_SRV("--", " End of MONITOR list ", "irc_733,irc_numeric,nick_server,log3"); } /* @@ -6480,8 +6489,8 @@ TEST(IrcProtocolWithServer, 734) CHECK_SRV("=!=", " (10)", "irc_734,irc_numeric,nick_server,log3"); RECV(":server 734 alice 10 nick1,nick2 full"); CHECK_SRV("=!=", "full (10)", "irc_734,irc_numeric,nick_server,log3"); - RECV(":server 734 alice 10 nick1,nick2 :Monitor list is full"); - CHECK_SRV("=!=", "Monitor list is full (10)", + RECV(":server 734 alice 10 nick1,nick2 : Monitor list is full "); + CHECK_SRV("=!=", " Monitor list is full (10)", "irc_734,irc_numeric,nick_server,log3"); } @@ -6502,11 +6511,11 @@ TEST(IrcProtocolWithServer, 742) RECV(":server 742 alice #test"); CHECK_SRV("--", "#test", "irc_742,irc_numeric,nick_server,log3"); - RECV(":server 742 alice #test n nstlk :MODE cannot be set due to channel " - "having an active MLOCK restriction policy"); + RECV(":server 742 alice #test n nstlk : MODE cannot be set due to channel " + "having an active MLOCK restriction policy "); CHECK_CHAN("--", - "#test: n nstlk MODE cannot be set due to channel having " - "an active MLOCK restriction policy", + "#test: n nstlk MODE cannot be set due to channel having " + "an active MLOCK restriction policy ", "irc_742,irc_numeric,nick_server,log3"); RECV(":server 742 alice #test2 n nstlk :MODE cannot be set due to channel " "having an active MLOCK restriction policy"); @@ -6538,12 +6547,11 @@ TEST(IrcProtocolWithServer, 900) RECV(":server 900 alice alice!user@host alice logged"); CHECK_SRV("--", "logged (alice!user@host)", "irc_900,irc_numeric,nick_server,log3"); - RECV(":server 900 alice alice!user@host alice " - ":You are now logged in as mynick"); - CHECK_SRV("--", "You are now logged in as mynick (alice!user@host)", + RECV(":server 900 alice alice!user@host alice : You are now logged in as mynick "); + CHECK_SRV("--", " You are now logged in as mynick (alice!user@host)", "irc_900,irc_numeric,nick_server,log3"); - RECV(":server 900 * * alice :You are now logged in as mynick"); - CHECK_SRV("--", "You are now logged in as mynick", + RECV(":server 900 * * alice : You are now logged in as mynick "); + CHECK_SRV("--", " You are now logged in as mynick ", "irc_900,irc_numeric,nick_server,log3"); } @@ -6566,8 +6574,8 @@ TEST(IrcProtocolWithServer, 901) RECV(":server 901 alice nick!user@host logged"); CHECK_SRV("--", "logged", "irc_901,irc_numeric,nick_server,log3"); - RECV(":server 901 alice nick!user@host :You are now logged out"); - CHECK_SRV("--", "You are now logged out", + RECV(":server 901 alice nick!user@host : You are now logged out "); + CHECK_SRV("--", " You are now logged out ", "irc_901,irc_numeric,nick_server,log3"); } @@ -6591,18 +6599,18 @@ TEST(IrcProtocolWithServer, 903_907) RECV(":server 903 alice ok"); CHECK_SRV("--", "ok", "irc_903,irc_numeric,nick_server,log3"); - RECV(":server 903 alice :SASL authentication successful"); - CHECK_SRV("--", "SASL authentication successful", + RECV(":server 903 alice : SASL authentication successful "); + CHECK_SRV("--", " SASL authentication successful ", "irc_903,irc_numeric,nick_server,log3"); - RECV(":server 903 * :SASL authentication successful"); - CHECK_SRV("--", "SASL authentication successful", + RECV(":server 903 * : SASL authentication successful "); + CHECK_SRV("--", " SASL authentication successful ", "irc_903,irc_numeric,nick_server,log3"); RECV(":server 907 alice ok"); CHECK_SRV("--", "ok", "irc_907,irc_numeric,nick_server,log3"); - RECV(":server 907 alice :SASL authentication successful"); - CHECK_SRV("--", "SASL authentication successful", + RECV(":server 907 alice : SASL authentication successful "); + CHECK_SRV("--", " SASL authentication successful ", "irc_907,irc_numeric,nick_server,log3"); } @@ -6636,26 +6644,26 @@ TEST(IrcProtocolWithServer, 902_904_905_906) RECV(":server 902 alice error"); CHECK_SRV("--", "error", "irc_902,irc_numeric,nick_server,log3"); - RECV(":server 902 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", + RECV(":server 902 alice : SASL authentication failed "); + CHECK_SRV("--", " SASL authentication failed ", "irc_902,irc_numeric,nick_server,log3"); RECV(":server 904 alice error"); CHECK_SRV("--", "error", "irc_904,irc_numeric,nick_server,log3"); - RECV(":server 904 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", + RECV(":server 904 alice : SASL authentication failed "); + CHECK_SRV("--", " SASL authentication failed ", "irc_904,irc_numeric,nick_server,log3"); RECV(":server 905 alice error"); CHECK_SRV("--", "error", "irc_905,irc_numeric,nick_server,log3"); - RECV(":server 905 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", + RECV(":server 905 alice : SASL authentication failed "); + CHECK_SRV("--", " SASL authentication failed ", "irc_905,irc_numeric,nick_server,log3"); RECV(":server 906 alice error"); CHECK_SRV("--", "error", "irc_906,irc_numeric,nick_server,log3"); - RECV(":server 906 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", + RECV(":server 906 alice : SASL authentication failed "); + CHECK_SRV("--", " SASL authentication failed ", "irc_906,irc_numeric,nick_server,log3"); } @@ -6683,8 +6691,8 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "mode", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 973 alice mode test"); CHECK_SRV("--", "mode: test", "irc_973,irc_numeric,nick_server,log3"); - RECV(":server 973 alice mode :test"); - CHECK_SRV("--", "mode: test", "irc_973,irc_numeric,nick_server,log3"); + RECV(":server 973 alice mode : test "); + CHECK_SRV("--", "mode: test ", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 974 alice"); CHECK_NO_MSG; @@ -6692,8 +6700,8 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "mode", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 974 alice mode test"); CHECK_SRV("--", "mode: test", "irc_974,irc_numeric,nick_server,log3"); - RECV(":server 974 alice mode :test"); - CHECK_SRV("--", "mode: test", "irc_974,irc_numeric,nick_server,log3"); + RECV(":server 974 alice mode : test "); + CHECK_SRV("--", "mode: test ", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 975 alice"); CHECK_NO_MSG; @@ -6701,8 +6709,8 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "mode", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 975 alice mode test"); CHECK_SRV("--", "mode: test", "irc_975,irc_numeric,nick_server,log3"); - RECV(":server 975 alice mode :test"); - CHECK_SRV("--", "mode: test", "irc_975,irc_numeric,nick_server,log3"); + RECV(":server 975 alice mode : test "); + CHECK_SRV("--", "mode: test ", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 973 bob"); CHECK_SRV("--", "bob", "irc_973,irc_numeric,nick_server,log3"); @@ -6710,8 +6718,8 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "bob: mode", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 973 bob mode test"); CHECK_SRV("--", "bob: mode test", "irc_973,irc_numeric,nick_server,log3"); - RECV(":server 973 bob mode :test"); - CHECK_SRV("--", "bob: mode test", "irc_973,irc_numeric,nick_server,log3"); + RECV(":server 973 bob mode : test "); + CHECK_SRV("--", "bob: mode test ", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 974 bob"); CHECK_SRV("--", "bob", "irc_974,irc_numeric,nick_server,log3"); @@ -6719,8 +6727,8 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "bob: mode", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 974 bob mode test"); CHECK_SRV("--", "bob: mode test", "irc_974,irc_numeric,nick_server,log3"); - RECV(":server 974 bob mode :test"); - CHECK_SRV("--", "bob: mode test", "irc_974,irc_numeric,nick_server,log3"); + RECV(":server 974 bob mode : test "); + CHECK_SRV("--", "bob: mode test ", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 975 bob"); CHECK_SRV("--", "bob", "irc_975,irc_numeric,nick_server,log3"); @@ -6728,6 +6736,6 @@ TEST(IrcProtocolWithServer, server_mode_reason) CHECK_SRV("--", "bob: mode", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 975 bob mode test"); CHECK_SRV("--", "bob: mode test", "irc_975,irc_numeric,nick_server,log3"); - RECV(":server 975 bob mode :test"); - CHECK_SRV("--", "bob: mode test", "irc_975,irc_numeric,nick_server,log3"); + RECV(":server 975 bob mode : test "); + CHECK_SRV("--", "bob: mode test ", "irc_975,irc_numeric,nick_server,log3"); }