From 21759171d27d66dcb6dbb96950ac55471d6604a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 30 Oct 2023 08:23:20 +0100 Subject: [PATCH] irc: add tags "nick_xxx" and "host_xxx" in all messages, including self and server messages --- ChangeLog.adoc | 1 + src/plugins/irc/irc-channel.c | 9 +- src/plugins/irc/irc-ctcp.c | 31 +- src/plugins/irc/irc-input.c | 28 +- src/plugins/irc/irc-protocol.c | 439 ++++---- src/plugins/irc/irc-protocol.h | 4 +- tests/unit/plugins/irc/test-irc-protocol.cpp | 1050 +++++++++--------- 7 files changed, 801 insertions(+), 761 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index dbfdb424b..acae24bad 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -18,6 +18,7 @@ New features:: * core: display only version with command `/version`, add options `-o` and `-ol` in command `/upgrade` * core: add number of processes in command `/sys waitpid` * core, alias, trigger: allow wildcard in commands `/bar`, `/item`, `/proxy`, `/alias` and `/trigger` (issue #1956) + * irc: add tags "nick_xxx" and "host_xxx" in all messages, including self and server messages * irc: add option irc.look.ignore_tag_messages (issue #989) Bug fixes:: diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 1b48557ad..7b598de33 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -1461,6 +1461,9 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server, memset (&ctxt, 0, sizeof (ctxt)); ctxt.server = server; + ctxt.nick = (nick) ? nick->name : NULL; + ctxt.nick_is_me = (irc_server_strcasecmp (server, ctxt.nick, server->nick) == 0); + ctxt.address = (nick) ? nick->host : NULL; ctxt.command = strdup ("nick_back"); for (ptr_channel = server->channels; ptr_channel; @@ -1475,11 +1478,7 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server, weechat_printf_date_tags ( ptr_channel->buffer, 0, - irc_protocol_tags ( - &ctxt, - NULL, /* extra_tags */ - (nick) ? nick->name : NULL, - (nick) ? nick->host : NULL), + irc_protocol_tags (&ctxt, NULL), _("%s%s%s %s(%s%s%s)%s is back on server"), weechat_prefix ("join"), irc_nick_color_for_msg (server, 1, nick, nickname), diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index 8e0952bc8..3e8b94416 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -190,7 +190,7 @@ irc_ctcp_display_request (struct t_irc_protocol_ctxt *ctxt, ctxt->server, ctxt->nick, NULL, "ctcp", (channel) ? channel->buffer : NULL), ctxt->date, - irc_protocol_tags (ctxt, "irc_ctcp", NULL, ctxt->address), + irc_protocol_tags (ctxt, "irc_ctcp"), _("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), @@ -256,7 +256,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt, irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->nick, NULL, "ctcp", NULL), ctxt->date, - irc_protocol_tags (ctxt, "irc_ctcp", NULL, NULL), + irc_protocol_tags (ctxt, "irc_ctcp"), /* TRANSLATORS: %.3fs is a float number + "s" ("seconds") */ _("%sCTCP reply from %s%s%s: %s%s%s %.3fs"), weechat_prefix ("network"), @@ -276,7 +276,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt, irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->nick, NULL, "ctcp", NULL), ctxt->date, - irc_protocol_tags (ctxt, "irc_ctcp", NULL, ctxt->address), + irc_protocol_tags (ctxt, "irc_ctcp"), _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), @@ -295,7 +295,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt, irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->nick, NULL, "ctcp", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), @@ -388,12 +388,9 @@ irc_ctcp_reply_to_nick (struct t_irc_protocol_ctxt *ctxt, "ctcp", (channel) ? channel->buffer : NULL), 0, - irc_protocol_tags ( - ctxt, - "irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight", - NULL, /* nick */ - NULL), /* address */ + irc_protocol_tags (ctxt, + "irc_ctcp,irc_ctcp_reply,self_msg," + "notify_none,no_highlight"), _("%sCTCP reply to %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), @@ -1399,9 +1396,7 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt, ctxt, (ctxt->nick_is_me) ? "irc_action,self_msg,notify_none,no_highlight" : - "irc_action,notify_message", - ctxt->nick, - ctxt->address), + "irc_action,notify_message"), "%s%s -> %s%s%s: %s%s%s%s%s%s", weechat_prefix ("network"), /* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me */ @@ -1426,9 +1421,7 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt, ctxt, (ctxt->nick_is_me) ? "irc_action,self_msg,notify_none,no_highlight" : - "irc_action,notify_message", - ctxt->nick, - ctxt->address), + "irc_action,notify_message"), "%s%s%s%s%s%s%s", weechat_prefix ("action"), irc_nick_mode_for_display (ctxt->server, ptr_nick, 0), @@ -1470,9 +1463,7 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt, ctxt, (ctxt->nick_is_me) ? "irc_action,self_msg,notify_none,no_highlight" : - "irc_action,notify_private", - ctxt->nick, - ctxt->address), + "irc_action,notify_private"), "%s%s%s%s%s%s", weechat_prefix ("action"), (ctxt->nick_is_me) ? @@ -1549,7 +1540,7 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt, ctxt->server, ctxt->nick, NULL, "ctcp", (channel) ? channel->buffer : NULL), ctxt->date, - irc_protocol_tags (ctxt, "irc_ctcp", NULL, ctxt->address), + irc_protocol_tags (ctxt, "irc_ctcp"), _("%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c index e1b5aa7f6..72820cc8a 100644 --- a/src/plugins/irc/irc-input.c +++ b/src/plugins/irc/irc-input.c @@ -136,6 +136,9 @@ irc_input_user_message_display (struct t_irc_server *server, if (ptr_channel && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)) ptr_nick = irc_nick_search (server, ptr_channel, server->nick); + ctxt.nick = (ptr_nick) ? ptr_nick->name : server->nick; + ctxt.nick_is_me = (irc_server_strcasecmp (server, ctxt.nick, server->nick) == 0); + if (is_action) { snprintf (str_tags, sizeof (str_tags), @@ -172,10 +175,7 @@ irc_input_user_message_display (struct t_irc_server *server, weechat_printf_date_tags ( ptr_buffer, date, - irc_protocol_tags (&ctxt, - str_tags, - (ptr_nick) ? ptr_nick->name : server->nick, - address), + irc_protocol_tags (&ctxt, str_tags), "%s%s -> %s%s%s: %s%s%s%s%s%s", weechat_prefix ("network"), /* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action */ @@ -196,10 +196,7 @@ irc_input_user_message_display (struct t_irc_server *server, weechat_printf_date_tags ( ptr_buffer, date, - irc_protocol_tags (&ctxt, - str_tags, - (ptr_nick) ? ptr_nick->name : server->nick, - address), + irc_protocol_tags (&ctxt, str_tags), "%s%s%s%s%s%s%s", weechat_prefix ("action"), irc_nick_mode_for_display (server, ptr_nick, 0), @@ -215,10 +212,7 @@ irc_input_user_message_display (struct t_irc_server *server, weechat_printf_date_tags ( ptr_buffer, date, - irc_protocol_tags (&ctxt, - str_tags, - (ptr_nick) ? ptr_nick->name : server->nick, - address), + irc_protocol_tags (&ctxt, str_tags), _("%sCTCP query to %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), (is_channel) ? @@ -236,10 +230,7 @@ irc_input_user_message_display (struct t_irc_server *server, weechat_printf_date_tags ( ptr_buffer, date, - irc_protocol_tags (&ctxt, - str_tags, - (ptr_nick) ? ptr_nick->name : server->nick, - address), + irc_protocol_tags (&ctxt, str_tags), "%s%s%s%s%s(%s%s%s%s)%s -> %s%s%s: %s", weechat_prefix ("network"), (is_notice) ? IRC_COLOR_NOTICE : "", @@ -265,10 +256,7 @@ irc_input_user_message_display (struct t_irc_server *server, weechat_printf_date_tags ( ptr_buffer, date, - irc_protocol_tags (&ctxt, - str_tags, - (ptr_nick) ? ptr_nick->name : server->nick, - address), + irc_protocol_tags (&ctxt, str_tags), "%s%s", irc_nick_as_prefix ( server, diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 3d4888f5a..1da7c8cfd 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -63,6 +63,51 @@ #include "irc-typing.h" +/* + * Frees data in structure t_irc_protocol_ctxt. + */ + +void +irc_protocol_ctxt_free_data (struct t_irc_protocol_ctxt *ctxt) +{ + if (ctxt->irc_message) + { + free (ctxt->irc_message); + ctxt->irc_message = NULL; + } + if (ctxt->tags) + { + weechat_hashtable_free (ctxt->tags); + ctxt->tags = NULL; + } + if (ctxt->nick) + { + free (ctxt->nick); + ctxt->nick = NULL; + } + if (ctxt->address) + { + free (ctxt->address); + ctxt->address = NULL; + } + if (ctxt->host) + { + free (ctxt->host); + ctxt->host = NULL; + } + if (ctxt->command) + { + free (ctxt->command); + ctxt->command = NULL; + } + if (ctxt->params) + { + weechat_string_free_split (ctxt->params); + ctxt->params = NULL; + } + ctxt->num_params = 0; +} + /* * Checks if a command is numeric. * @@ -163,24 +208,60 @@ irc_protocol_tags_add_cb (void *data, */ const char * -irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, - const char *extra_tags, const char *nick, const char *address) +irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, const char *extra_tags) { static char string[4096]; - int log_level, is_numeric, has_irc_tags; - const char *ptr_tag_batch; - char str_log_level[32], **str_irc_tags; + const char *ptr_tag_batch, *ptr_nick, *ptr_address; + char **tags, str_log_level[32], **str_irc_tags; + int i, count_tags, self_msg, has_nick, has_host, log_level; + int is_numeric, has_irc_tags; struct t_irc_batch *ptr_batch; str_log_level[0] = '\0'; + str_irc_tags = NULL; + ptr_nick = NULL; + ptr_address = NULL; is_numeric = irc_protocol_is_numeric_command (ctxt->command); has_irc_tags = (ctxt->tags && weechat_hashtable_get_integer (ctxt->tags, "items_count") > 0); - - if (!ctxt->command && !has_irc_tags && !extra_tags && !nick) - return NULL; + self_msg = 0; + has_nick = 0; + has_host = 0; + if (extra_tags && extra_tags[0]) + { + tags = weechat_string_split (extra_tags, ",", NULL, + WEECHAT_STRING_SPLIT_STRIP_LEFT + | WEECHAT_STRING_SPLIT_STRIP_RIGHT + | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, + 0, &count_tags); + if (tags) + { + for (i = 0; i < count_tags; i++) + { + if (strcmp (tags[i], "self_msg") == 0) + self_msg = 1; + else if (strncmp (tags[i], "nick_", 5) == 0) + has_nick = 1; + else if (strncmp (tags[i], "host_", 5) == 0) + has_host = 1; + } + weechat_string_free_split (tags); + } + } + if (!has_nick) + { + ptr_nick = (self_msg) ? + ((ctxt->server) ? ctxt->server->nick : NULL) : ctxt->nick; + if (!has_host) + { + if (self_msg) + ptr_address = (ctxt->nick && ctxt->nick_is_me) ? ctxt->address : NULL; + else + ptr_address = ctxt->address; + } + } if (has_irc_tags) { @@ -205,10 +286,6 @@ irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, } } } - else - { - str_irc_tags = NULL; - } if (ctxt->command && ctxt->command[0]) { @@ -231,16 +308,19 @@ irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, (extra_tags && extra_tags[0]) ? "," : "", (extra_tags && extra_tags[0]) ? extra_tags : "", (ctxt->ignore_tag) ? ",irc_ignored" : "", - (nick && nick[0]) ? ",nick_" : "", - (nick && nick[0]) ? nick : "", - (address && address[0]) ? ",host_" : "", - (address && address[0]) ? address : "", + (ptr_nick && ptr_nick[0]) ? ",nick_" : "", + (ptr_nick && ptr_nick[0]) ? ptr_nick : "", + (ptr_address && ptr_address[0]) ? ",host_" : "", + (ptr_address && ptr_address[0]) ? ptr_address : "", str_log_level); if (str_irc_tags) weechat_string_dyn_free (str_irc_tags, 1); - return string; + if (!string[0]) + return NULL; + + return (string[0] == ',') ? string + 1 : string; } /* @@ -398,7 +478,7 @@ irc_protocol_print_error_warning_msg (struct t_irc_protocol_ctxt *ctxt, weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s%s%s[%s%s%s]%s %s", (prefix) ? prefix : "", (label) ? label : "", @@ -467,7 +547,7 @@ IRC_PROTOCOL_CALLBACK(account) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, NULL), (pos_account) ? _("%s%s%s%s has identified as %s") : _("%s%s%s%s has unidentified"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->nick), @@ -497,9 +577,7 @@ IRC_PROTOCOL_CALLBACK(account) ctxt->date, irc_protocol_tags ( ctxt, - (smart_filter) ? "irc_smart_filter" : NULL, - ctxt->nick, - ctxt->address), + (smart_filter) ? "irc_smart_filter" : NULL), (pos_account) ? _("%s%s%s%s has identified as %s") : _("%s%s%s%s has unidentified"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -1394,8 +1472,7 @@ IRC_PROTOCOL_CALLBACK(chghost) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, str_tags, ctxt->nick, - ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%s%s%s%s (%s%s%s)%s has changed host to %s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->nick), @@ -1431,8 +1508,7 @@ IRC_PROTOCOL_CALLBACK(chghost) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, str_tags, ctxt->nick, - ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%s%s%s%s (%s%s%s)%s has changed host to %s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -1474,7 +1550,7 @@ IRC_PROTOCOL_CALLBACK(error) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("error"), str_error); @@ -1575,7 +1651,7 @@ IRC_PROTOCOL_CALLBACK(generic_error) || (strcmp (ctxt->command, "402") == 0)) ? "whois" : NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s", weechat_prefix ("network"), str_target, @@ -1634,8 +1710,7 @@ IRC_PROTOCOL_CALLBACK(invite) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, "notify_highlight", ctxt->nick, - ctxt->address), + irc_protocol_tags (ctxt, "notify_highlight"), _("%sYou have been invited to %s%s%s by %s%s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -1652,7 +1727,7 @@ IRC_PROTOCOL_CALLBACK(invite) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has invited %s%s%s to %s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->nick), @@ -1804,9 +1879,7 @@ IRC_PROTOCOL_CALLBACK(join) ptr_channel->buffer), ctxt->date, irc_protocol_tags (ctxt, - (smart_filter) ? "irc_smart_filter" : NULL, - ctxt->nick, - ctxt->address), + (smart_filter) ? "irc_smart_filter" : NULL), _("%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"), weechat_prefix ("join"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -1904,7 +1977,7 @@ IRC_PROTOCOL_CALLBACK(kick) irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has kicked %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -1924,7 +1997,7 @@ IRC_PROTOCOL_CALLBACK(kick) irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has kicked %s%s%s"), weechat_prefix ("quit"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -2024,7 +2097,7 @@ IRC_PROTOCOL_CALLBACK(kill) irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%sYou were killed by %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), IRC_COLOR_MESSAGE_KICK, @@ -2042,7 +2115,7 @@ IRC_PROTOCOL_CALLBACK(kill) irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%sYou were killed by %s%s%s"), weechat_prefix ("quit"), IRC_COLOR_MESSAGE_KICK, @@ -2099,7 +2172,7 @@ IRC_PROTOCOL_CALLBACK(knock_reply) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->params[0], ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -2154,9 +2227,7 @@ IRC_PROTOCOL_CALLBACK(mode) ctxt->date, irc_protocol_tags ( ctxt, - (smart_filter && !ctxt->nick_is_me) ? "irc_smart_filter" : NULL, - NULL, - ctxt->address), + (smart_filter && !ctxt->nick_is_me) ? "irc_smart_filter" : NULL), _("%sMode %s%s %s[%s%s%s%s%s]%s by %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -2178,7 +2249,7 @@ IRC_PROTOCOL_CALLBACK(mode) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%sUser mode %s[%s%s%s]%s by %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -2239,7 +2310,7 @@ IRC_PROTOCOL_CALLBACK(nick) weechat_printf_date_tags ( ctxt->server->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, NULL, ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%sYou are now known as %s%s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_NICK_SELF, @@ -2302,8 +2373,7 @@ IRC_PROTOCOL_CALLBACK(nick) weechat_printf_date_tags ( ptr_channel->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, NULL, - ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%s%s%s%s is now known as %s%s%s"), weechat_prefix ("network"), old_color, @@ -2344,8 +2414,7 @@ IRC_PROTOCOL_CALLBACK(nick) weechat_printf_date_tags (ptr_channel->buffer, ctxt->date, irc_protocol_tags ( - ctxt, str_tags, NULL, - ctxt->address), + ctxt, str_tags), _("%sYou are now known as " "%s%s%s"), weechat_prefix ("network"), @@ -2375,8 +2444,7 @@ IRC_PROTOCOL_CALLBACK(nick) weechat_printf_date_tags ( ptr_channel->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, NULL, - ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%s%s%s%s is now known as %s%s%s"), weechat_prefix ("network"), weechat_config_boolean (irc_config_look_color_nicks_in_server_messages) ? @@ -2574,7 +2642,7 @@ IRC_PROTOCOL_CALLBACK(notice) weechat_printf_date_tags ( (ptr_channel) ? ptr_channel->buffer : ctxt->server->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, str_tags), "%s%s%s%s%s(%s%s%s%s)%s%s%s%s%s: %s", weechat_prefix ("network"), IRC_COLOR_NOTICE, @@ -2653,8 +2721,7 @@ IRC_PROTOCOL_CALLBACK(notice) weechat_printf_date_tags ( ptr_channel->buffer, ctxt->date, - irc_protocol_tags (ctxt, "notify_private", ctxt->nick, - ctxt->address), + irc_protocol_tags (ctxt, "notify_private"), "%s%s%s%s: %s", weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 0, NULL, ctxt->nick), @@ -2683,9 +2750,7 @@ IRC_PROTOCOL_CALLBACK(notice) ctxt->date, irc_protocol_tags ( ctxt, - (notify_private) ? "notify_private" : NULL, - ctxt->server->nick, - ctxt->address), + (notify_private) ? "notify_private" : NULL), "%s%s%s%s -> %s%s%s: %s", weechat_prefix ("network"), IRC_COLOR_NOTICE, @@ -2712,9 +2777,7 @@ IRC_PROTOCOL_CALLBACK(notice) ctxt->date, irc_protocol_tags ( ctxt, - (notify_private) ? "notify_private" : NULL, - ctxt->nick, - ctxt->address), + (notify_private) ? "notify_private" : NULL), "%s%s%s%s", weechat_prefix ("network"), nick_address, @@ -2787,9 +2850,7 @@ IRC_PROTOCOL_CALLBACK(part) || !weechat_config_boolean (irc_config_look_smart_filter) || !weechat_config_boolean (irc_config_look_smart_filter_quit) || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - ctxt->nick, - ctxt->address), + NULL : "irc_smart_filter"), _("%s%s%s%s%s%s%s%s%s%s has left %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -2822,9 +2883,7 @@ IRC_PROTOCOL_CALLBACK(part) || !weechat_config_boolean (irc_config_look_smart_filter) || !weechat_config_boolean (irc_config_look_smart_filter_quit) || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - ctxt->nick, - ctxt->address), + NULL : "irc_smart_filter"), _("%s%s%s%s%s%s%s%s%s%s has left %s%s%s"), weechat_prefix ("quit"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -2954,7 +3013,7 @@ IRC_PROTOCOL_CALLBACK(pong) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "PONG%s%s", (str_params) ? ": " : "", (str_params) ? str_params : ""); @@ -3112,9 +3171,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) irc_protocol_tags ( ctxt, (ctxt->nick_is_me) ? - "self_msg,notify_none,no_highlight" : "notify_message", - ctxt->nick, - ctxt->address), + "self_msg,notify_none,no_highlight" : "notify_message"), "%s%s%s(%s%s%s%s)%s -> %s%s%s: %s", weechat_prefix ("network"), "Msg", @@ -3157,7 +3214,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) weechat_printf_date_tags ( ptr_channel->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, str_tags), "%s%s", irc_nick_as_prefix (ctxt->server, ptr_nick, (ptr_nick) ? NULL : ctxt->nick, @@ -3304,7 +3361,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) weechat_printf_date_tags ( (ptr_channel) ? ptr_channel->buffer : ctxt->server->buffer, ctxt->date, - irc_protocol_tags (ctxt, str_tags, ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, str_tags), "%s%s", irc_nick_as_prefix ( ctxt->server, NULL, ctxt->nick, @@ -3396,9 +3453,7 @@ IRC_PROTOCOL_CALLBACK(quit) || !weechat_config_boolean (irc_config_look_smart_filter) || !weechat_config_boolean (irc_config_look_smart_filter_quit) || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - ctxt->nick, - ctxt->address), + NULL : "irc_smart_filter"), _("%s%s%s%s%s%s%s%s%s%s has quit %s(%s%s%s)"), weechat_prefix ("quit"), (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? @@ -3430,9 +3485,7 @@ IRC_PROTOCOL_CALLBACK(quit) || !weechat_config_boolean (irc_config_look_smart_filter) || !weechat_config_boolean (irc_config_look_smart_filter_quit) || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - ctxt->nick, - ctxt->address), + NULL : "irc_smart_filter"), _("%s%s%s%s%s%s%s%s%s%s has quit"), weechat_prefix ("quit"), (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? @@ -3508,7 +3561,7 @@ IRC_PROTOCOL_CALLBACK(setname) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has changed real name to %s\"%s%s%s\"%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->nick), @@ -3541,9 +3594,7 @@ IRC_PROTOCOL_CALLBACK(setname) ctxt->date, irc_protocol_tags ( ctxt, - (smart_filter) ? "irc_smart_filter" : NULL, - NULL, - NULL), + (smart_filter) ? "irc_smart_filter" : NULL), _("%s%s%s%s has changed real name to %s\"%s%s%s\"%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->nick), @@ -3571,7 +3622,7 @@ IRC_PROTOCOL_CALLBACK(setname) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%sYour real name has been set to %s\"%s%s%s\"%s"), weechat_prefix ("network"), IRC_COLOR_MESSAGE_SETNAME, @@ -3674,7 +3725,7 @@ IRC_PROTOCOL_CALLBACK(server_mode_reason) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s", weechat_prefix ("network"), pos_mode, @@ -3709,7 +3760,7 @@ IRC_PROTOCOL_CALLBACK(numeric) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), str_params); @@ -3773,7 +3824,7 @@ IRC_PROTOCOL_CALLBACK(topic) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has changed topic for %s%s%s from \"%s%s%s\" to " "\"%s%s%s\""), weechat_prefix ("network"), @@ -3798,7 +3849,7 @@ IRC_PROTOCOL_CALLBACK(topic) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has changed topic for %s%s%s to \"%s%s%s\""), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -3826,7 +3877,7 @@ IRC_PROTOCOL_CALLBACK(topic) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has unset topic for %s%s%s (old topic: " "\"%s%s%s\")"), weechat_prefix ("network"), @@ -3848,7 +3899,7 @@ IRC_PROTOCOL_CALLBACK(topic) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s%s%s has unset topic for %s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, ptr_nick, ctxt->nick), @@ -3896,7 +3947,7 @@ IRC_PROTOCOL_CALLBACK(wallops) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, "notify_private", ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, "notify_private"), _("%sWallops from %s: %s"), weechat_prefix ("network"), (nick_address[0]) ? nick_address : "?", @@ -4205,7 +4256,7 @@ IRC_PROTOCOL_CALLBACK(008) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->params[0], ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%sServer notice mask for %s%s%s: %s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->params[0]), @@ -4237,7 +4288,7 @@ IRC_PROTOCOL_CALLBACK(221) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->params[0], ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%sUser mode for %s%s%s is %s[%s%s%s]"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->params[0]), @@ -4294,7 +4345,7 @@ IRC_PROTOCOL_CALLBACK(301) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s]%s is away: %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4334,7 +4385,7 @@ IRC_PROTOCOL_CALLBACK(303) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sUsers online: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_NICK, @@ -4366,7 +4417,7 @@ IRC_PROTOCOL_CALLBACK(305) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "unaway", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), str_away_msg); @@ -4402,7 +4453,7 @@ IRC_PROTOCOL_CALLBACK(306) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "away", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), str_away_msg); @@ -4441,7 +4492,7 @@ IRC_PROTOCOL_CALLBACK(whois_nick_msg) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4485,7 +4536,7 @@ IRC_PROTOCOL_CALLBACK(whowas_nick_msg) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whowas", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4533,7 +4584,7 @@ IRC_PROTOCOL_CALLBACK(311) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] (%s%s@%s%s)%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4577,7 +4628,7 @@ IRC_PROTOCOL_CALLBACK(312) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4621,7 +4672,7 @@ IRC_PROTOCOL_CALLBACK(314) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whowas", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] (%s%s@%s%s)%s was %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4667,7 +4718,7 @@ IRC_PROTOCOL_CALLBACK(315) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "who", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4714,7 +4765,7 @@ IRC_PROTOCOL_CALLBACK(317) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s]%s idle: %s%d %s%s, %s%02d %s%s %s%02d %s%s %s%02d " "%s%s, signon at: %s%s"), weechat_prefix ("network"), @@ -4747,7 +4798,7 @@ IRC_PROTOCOL_CALLBACK(317) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s]%s idle: %s%02d %s%s %s%02d %s%s %s%02d %s%s, " "signon at: %s%s"), weechat_prefix ("network"), @@ -4794,7 +4845,7 @@ IRC_PROTOCOL_CALLBACK(321) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "list", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s", weechat_prefix ("network"), ctxt->params[1], @@ -4828,7 +4879,7 @@ IRC_PROTOCOL_CALLBACK(322) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "list", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s(%s%s%s)%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -4865,7 +4916,7 @@ IRC_PROTOCOL_CALLBACK(323) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, "list", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), str_params); @@ -4914,7 +4965,7 @@ IRC_PROTOCOL_CALLBACK(324) ctxt->server, NULL, ctxt->command, NULL, (ptr_channel) ? ptr_channel->buffer : NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, ctxt->address), + irc_protocol_tags (ctxt, NULL), _("%sMode %s%s %s[%s%s%s]"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -4967,7 +5018,7 @@ IRC_PROTOCOL_CALLBACK(327) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s %s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -4987,7 +5038,7 @@ IRC_PROTOCOL_CALLBACK(327) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5028,7 +5079,7 @@ IRC_PROTOCOL_CALLBACK(328) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sURL for %s%s%s: %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -5069,7 +5120,7 @@ IRC_PROTOCOL_CALLBACK(329) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "created on" is a date */ _("%sChannel created on %s"), weechat_prefix ("network"), @@ -5081,7 +5132,7 @@ IRC_PROTOCOL_CALLBACK(329) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "created on" is a date */ _("%sChannel %s%s%s created on %s"), weechat_prefix ("network"), @@ -5122,7 +5173,7 @@ IRC_PROTOCOL_CALLBACK(330_343) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5146,7 +5197,7 @@ IRC_PROTOCOL_CALLBACK(330_343) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5182,7 +5233,7 @@ IRC_PROTOCOL_CALLBACK(331) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sNo topic set for channel %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -5243,7 +5294,7 @@ IRC_PROTOCOL_CALLBACK(332) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sTopic for %s%s%s is \"%s%s%s\""), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -5308,7 +5359,7 @@ IRC_PROTOCOL_CALLBACK(333) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%sTopic set by %s%s%s%s%s%s%s%s%s on %s"), weechat_prefix ("network"), @@ -5329,7 +5380,7 @@ IRC_PROTOCOL_CALLBACK(333) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%sTopic set on %s"), weechat_prefix ("network"), @@ -5345,7 +5396,7 @@ IRC_PROTOCOL_CALLBACK(333) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%sTopic for %s%s%s set by %s%s%s%s%s%s%s%s%s on %s"), weechat_prefix ("network"), @@ -5369,7 +5420,7 @@ IRC_PROTOCOL_CALLBACK(333) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%sTopic for %s%s%s set on %s"), weechat_prefix ("network"), @@ -5413,7 +5464,7 @@ IRC_PROTOCOL_CALLBACK(338) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s %s %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5441,12 +5492,16 @@ IRC_PROTOCOL_CALLBACK(338) IRC_PROTOCOL_CALLBACK(341) { + char str_tags[1024]; + IRC_PROTOCOL_MIN_PARAMS(3); + snprintf (str_tags, sizeof (str_tags), "nick_%s", ctxt->params[0]); + weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->params[0], ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, ctxt->params[0], ctxt->address), + irc_protocol_tags (ctxt, str_tags), _("%s%s%s%s has invited %s%s%s to %s%s%s"), weechat_prefix ("network"), irc_nick_color_for_msg (ctxt->server, 1, NULL, ctxt->params[0]), @@ -5485,7 +5540,7 @@ IRC_PROTOCOL_CALLBACK(344) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, "reop", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sChannel reop %s%s%s: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -5509,7 +5564,7 @@ IRC_PROTOCOL_CALLBACK(344) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5552,7 +5607,7 @@ IRC_PROTOCOL_CALLBACK(345) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, "reop", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -5623,7 +5678,7 @@ IRC_PROTOCOL_CALLBACK(346) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "invitelist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s%s invited by %s on %s"), weechat_prefix ("network"), @@ -5646,7 +5701,7 @@ IRC_PROTOCOL_CALLBACK(346) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "invitelist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s invited by %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5668,7 +5723,7 @@ IRC_PROTOCOL_CALLBACK(346) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "invitelist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s invited"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5723,7 +5778,7 @@ IRC_PROTOCOL_CALLBACK(347) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "invitelist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5796,7 +5851,7 @@ IRC_PROTOCOL_CALLBACK(348) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "exceptionlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s]%s%s exception %s%s%s by %s on %s"), weechat_prefix ("network"), @@ -5820,7 +5875,7 @@ IRC_PROTOCOL_CALLBACK(348) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "exceptionlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s]%s%s exception %s%s%s by %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5843,7 +5898,7 @@ IRC_PROTOCOL_CALLBACK(348) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "exceptionlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s]%s%s exception %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5898,7 +5953,7 @@ IRC_PROTOCOL_CALLBACK(349) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "exceptionlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5953,7 +6008,7 @@ IRC_PROTOCOL_CALLBACK(350) irc_msgbuffer_get_target_buffer ( ctxt->server, ctxt->params[1], ctxt->command, "whois", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -5999,7 +6054,7 @@ IRC_PROTOCOL_CALLBACK(351) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s %s (%s)", weechat_prefix ("network"), ctxt->params[1], @@ -6013,7 +6068,7 @@ IRC_PROTOCOL_CALLBACK(351) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s %s", weechat_prefix ("network"), ctxt->params[1], @@ -6105,7 +6160,7 @@ IRC_PROTOCOL_CALLBACK(352) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "who", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s(%s%s@%s%s)%s %s%s%s%s%s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -6277,7 +6332,7 @@ IRC_PROTOCOL_CALLBACK(353) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "names", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sNicks %s%s%s: %s[%s%s%s]"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -6331,7 +6386,7 @@ IRC_PROTOCOL_CALLBACK(354) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "who", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -6402,7 +6457,7 @@ IRC_PROTOCOL_CALLBACK(354) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "who", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s] %s%s %s[%s%s%s] (%s%s@%s%s)%s %s %s %s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -6695,7 +6750,7 @@ IRC_PROTOCOL_CALLBACK(366) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "names", ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sNicks %s%s%s%s: %s[%s%s]"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -6721,7 +6776,7 @@ IRC_PROTOCOL_CALLBACK(366) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "names", ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%sChannel %s%s%s: %s%d%s %s %s(%s%s)"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -6760,7 +6815,7 @@ IRC_PROTOCOL_CALLBACK(366) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "names", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s%s%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -6841,7 +6896,7 @@ IRC_PROTOCOL_CALLBACK(367) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "banlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s%s banned by %s on %s"), weechat_prefix ("network"), @@ -6864,7 +6919,7 @@ IRC_PROTOCOL_CALLBACK(367) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "banlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s banned by %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -6886,7 +6941,7 @@ IRC_PROTOCOL_CALLBACK(367) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "banlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s banned"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -6944,7 +6999,7 @@ IRC_PROTOCOL_CALLBACK(368) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "banlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -7145,7 +7200,7 @@ IRC_PROTOCOL_CALLBACK(438) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s (%s => %s)", weechat_prefix ("network"), str_params, @@ -7159,7 +7214,7 @@ IRC_PROTOCOL_CALLBACK(438) weechat_printf_date_tags ( ptr_buffer, ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s %s", weechat_prefix ("network"), ctxt->params[0], @@ -7305,7 +7360,7 @@ IRC_PROTOCOL_CALLBACK(help) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, "notify_private", ctxt->nick, ctxt->address), + irc_protocol_tags (ctxt, "notify_private"), "%s%s", weechat_prefix ("network"), str_message); @@ -7326,8 +7381,8 @@ IRC_PROTOCOL_CALLBACK(help) IRC_PROTOCOL_CALLBACK(710) { struct t_irc_channel *ptr_channel; - const char *nick_address; - char *str_message; + const char *nick, *address, *nick_address; + char *str_message, str_tags[1024]; IRC_PROTOCOL_MIN_PARAMS(3); @@ -7338,9 +7393,15 @@ IRC_PROTOCOL_CALLBACK(710) if (!ptr_channel) return WEECHAT_RC_ERROR; - nick_address = irc_protocol_nick_address ( - ctxt->server, 1, NULL, irc_message_get_nick_from_host (ctxt->params[2]), - irc_message_get_address_from_host (ctxt->params[2])); + nick = irc_message_get_nick_from_host (ctxt->params[2]); + address = irc_message_get_address_from_host (ctxt->params[2]); + nick_address = irc_protocol_nick_address (ctxt->server, 1, NULL, nick, address); + + snprintf (str_tags, sizeof (str_tags), + "notify_message,nick_%s%s%s", + nick, + (address && address[0]) ? ",host_" : "", + (address && address[0]) ? address : ""); str_message = irc_protocol_string_params (ctxt->params, 3, ctxt->num_params - 1); @@ -7348,7 +7409,7 @@ IRC_PROTOCOL_CALLBACK(710) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, NULL, ptr_channel->buffer), ctxt->date, - irc_protocol_tags (ctxt, "notify_message", NULL, NULL), + irc_protocol_tags (ctxt, str_tags), "%s%s %s", weechat_prefix ("network"), (nick_address[0]) ? nick_address : "?", @@ -7420,7 +7481,7 @@ IRC_PROTOCOL_CALLBACK(728) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "quietlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s%s quieted by %s on %s"), weechat_prefix ("network"), @@ -7443,7 +7504,7 @@ IRC_PROTOCOL_CALLBACK(728) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "quietlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s quieted by %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -7465,7 +7526,7 @@ IRC_PROTOCOL_CALLBACK(728) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "quietlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), _("%s%s[%s%s%s] %s%s%s%s quieted"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -7523,7 +7584,7 @@ IRC_PROTOCOL_CALLBACK(729) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "quietlist", ptr_buffer), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s[%s%s%s]%s%s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, @@ -7656,7 +7717,7 @@ IRC_PROTOCOL_CALLBACK(732) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "monitor", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), (str_nicks) ? str_nicks : ""); @@ -7687,7 +7748,7 @@ IRC_PROTOCOL_CALLBACK(733) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "monitor", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), (str_params) ? str_params : ""); @@ -7718,7 +7779,7 @@ IRC_PROTOCOL_CALLBACK(734) irc_msgbuffer_get_target_buffer ( ctxt->server, NULL, ctxt->command, "monitor", NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s (%s)", weechat_prefix ("error"), (str_params) ? str_params : "", @@ -7754,7 +7815,7 @@ IRC_PROTOCOL_CALLBACK(900) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s %s(%s%s%s)", weechat_prefix ("network"), str_params, @@ -7768,7 +7829,7 @@ IRC_PROTOCOL_CALLBACK(900) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), str_params); @@ -7796,7 +7857,7 @@ IRC_PROTOCOL_CALLBACK(901) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, NULL), ctxt->date, - irc_protocol_tags (ctxt, NULL, NULL, NULL), + irc_protocol_tags (ctxt, NULL), "%s%s", weechat_prefix ("network"), ctxt->params[2]); @@ -7873,51 +7934,6 @@ IRC_PROTOCOL_CALLBACK(sasl_end_fail) return WEECHAT_RC_OK; } -/* - * Frees data in structure t_irc_protocol_ctxt. - */ - -void -irc_protocol_ctxt_free_data (struct t_irc_protocol_ctxt *ctxt) -{ - if (ctxt->irc_message) - { - free (ctxt->irc_message); - ctxt->irc_message = NULL; - } - if (ctxt->tags) - { - weechat_hashtable_free (ctxt->tags); - ctxt->tags = NULL; - } - if (ctxt->nick) - { - free (ctxt->nick); - ctxt->nick = NULL; - } - if (ctxt->address) - { - free (ctxt->address); - ctxt->address = NULL; - } - if (ctxt->host) - { - free (ctxt->host); - ctxt->host = NULL; - } - if (ctxt->command) - { - free (ctxt->command); - ctxt->command = NULL; - } - if (ctxt->params) - { - weechat_string_free_split (ctxt->params); - ctxt->params = NULL; - } - ctxt->num_params = 0; -} - /* * Executes action when an IRC command is received. * @@ -8132,6 +8148,7 @@ irc_protocol_recv_command (struct t_irc_server *server, ctxt.irc_message = NULL; ctxt.tags = NULL; ctxt.nick = NULL; + ctxt.nick_is_me = 0; ctxt.address = NULL; ctxt.host = NULL; ctxt.command = NULL; diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h index 41d21a56e..f287f29ed 100644 --- a/src/plugins/irc/irc-protocol.h +++ b/src/plugins/irc/irc-protocol.h @@ -87,9 +87,7 @@ struct t_irc_protocol_msg }; extern const char *irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, - const char *extra_tags, - const char *nick, - const char *address); + const char *extra_tags); extern time_t irc_protocol_parse_time (const char *time); extern void irc_protocol_recv_command (struct t_irc_server *server, const char *irc_message, diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 6619f9c89..bd642a122 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -75,19 +75,18 @@ extern char *irc_protocol_cap_to_enable (const char *capabilities, "userhost-in-names" #define WEE_CHECK_PROTOCOL_TAGS(__result, __server, __command, __tags, \ - __extra_tags, __nick, __address) \ + __extra_tags) \ ctxt.server = __server; \ ctxt.command = (char *)__command; \ ctxt.tags = __tags; \ if (__result == NULL) \ { \ - POINTERS_EQUAL(NULL, irc_protocol_tags (&ctxt, __extra_tags, \ - __nick, __address)); \ + POINTERS_EQUAL(NULL, irc_protocol_tags (&ctxt, __extra_tags)); \ } \ else \ { \ - STRCMP_EQUAL(__result, irc_protocol_tags (&ctxt, __extra_tags, \ - __nick, __address)); \ + STRCMP_EQUAL(__result, irc_protocol_tags (&ctxt, \ + __extra_tags)); \ } #define WEE_CHECK_CAP_TO_ENABLE(__result, __string, __sasl_requested) \ @@ -220,7 +219,7 @@ extern char *irc_protocol_cap_to_enable (const char *capabilities, #define SRV_INIT \ RECV(":server 001 alice :Welcome on this server, alice!"); \ CHECK_SRV("--", "Welcome on this server, alice!", \ - "irc_001,irc_numeric,log3"); + "irc_001,irc_numeric,nick_server,log3"); #define SRV_INIT_JOIN \ SRV_INIT; \ @@ -458,13 +457,19 @@ TEST(IrcProtocol, LogLevelForCommand) * irc_protocol_tags */ -TEST(IrcProtocol, Tags) +TEST(IrcProtocolWithServer, Tags) { struct t_irc_protocol_ctxt ctxt; struct t_hashtable *tags_empty, *tags_1, *tags_2; + SRV_INIT; + memset (&ctxt, 0, sizeof (ctxt)); + ctxt.nick = strdup ("alice"); + ctxt.nick_is_me = 1; + ctxt.address = strdup ("user@example.com"); + tags_empty = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, @@ -485,90 +490,96 @@ TEST(IrcProtocol, Tags) hashtable_set (tags_2, "key_3_empty", ""); hashtable_set (tags_2, "key_4_null", NULL); - WEE_CHECK_PROTOCOL_TAGS(NULL, NULL, NULL, NULL, NULL, NULL, NULL); + WEE_CHECK_PROTOCOL_TAGS("nick_alice,host_user@example.com", + NULL, NULL, NULL, NULL); /* command */ - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,log1", - NULL, "privmsg", NULL, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,log4", - NULL, "join", NULL, NULL, NULL, NULL); + WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,nick_alice,host_user@example.com,log1", + NULL, "privmsg", NULL, NULL); + WEE_CHECK_PROTOCOL_TAGS("irc_join,nick_alice,host_user@example.com,log4", + NULL, "join", NULL, NULL); /* command + irc_msg_tags */ - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,log1", - NULL, "privmsg", tags_empty, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,log4", - NULL, "join", tags_empty, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1,log1", - NULL, "privmsg", tags_1, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1,log4", - NULL, "join", tags_1, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,log1", - NULL, "privmsg", tags_2, NULL, NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,log4", - NULL, "join", tags_2, NULL, NULL, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,nick_alice,host_user@example.com,log1", + NULL, "privmsg", tags_empty, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_join,nick_alice,host_user@example.com,log4", + NULL, "join", tags_empty, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,irc_tag_key1=value1,nick_alice,host_user@example.com,log1", + NULL, "privmsg", tags_1, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_join,irc_tag_key1=value1,nick_alice,host_user@example.com,log4", + NULL, "join", tags_1, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,irc_tag_key1=value1," + "irc_tag_key_2;comma=value2;comma," + "irc_tag_key_3_empty=,irc_tag_key_4_null,nick_alice," + "host_user@example.com,log1", + NULL, "privmsg", tags_2, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_join,irc_tag_key1=value1," + "irc_tag_key_2;comma=value2;comma," + "irc_tag_key_3_empty=,irc_tag_key_4_null,nick_alice," + "host_user@example.com,log4", + NULL, "join", tags_2, NULL); /* command + extra_tags */ - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,log1", - NULL, "privmsg", NULL, "", NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,log4", - NULL, "join", NULL, "", NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,tag1,tag2,log1", - NULL, "privmsg", NULL, "tag1,tag2", NULL, NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,tag1,tag2,log4", - NULL, "join", NULL, "tag1,tag2", NULL, NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,nick_alice,host_user@example.com,log1", + NULL, "privmsg", NULL, ""); + WEE_CHECK_PROTOCOL_TAGS( + "irc_join,nick_alice,host_user@example.com,log4", + NULL, "join", NULL, ""); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,tag1,tag2,nick_alice,host_user@example.com,log1", + NULL, "privmsg", NULL, "tag1,tag2"); + WEE_CHECK_PROTOCOL_TAGS( + "irc_join,tag1,tag2,nick_alice,host_user@example.com,log4", + NULL, "join", NULL, "tag1,tag2"); /* command + irc_msg_tags + extra_tags + nick */ - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,log1", - NULL, "privmsg", tags_2, "tag1,tag2", "", NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,log4", - NULL, "join", tags_2, "tag1,tag2", "", NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_alice,log1", - NULL, "privmsg", tags_2, "tag1,tag2", "alice", NULL); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_bob,log4", - NULL, "join", tags_2, "tag1,tag2", "bob", NULL); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,irc_tag_key1=value1,irc_tag_key_2;comma=value2;comma," + "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1,tag2,nick_bob,log1", + NULL, "privmsg", tags_2, "tag1,tag2,nick_bob"); /* command + irc_msg_tags + extra_tags + nick + address */ - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_alice,log1", - NULL, "privmsg", tags_2, "tag1,tag2", "alice", ""); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_bob,log4", - NULL, "join", tags_2, "tag1,tag2", "bob", ""); - WEE_CHECK_PROTOCOL_TAGS("irc_privmsg,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_alice," - "host_example.com,log1", - NULL, "privmsg", tags_2, "tag1,tag2", "alice", "example.com"); - WEE_CHECK_PROTOCOL_TAGS("irc_join,irc_tag_key1=value1," - "irc_tag_key_2;comma=value2;comma," - "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1," - "tag2,nick_bob,host_example.com,log4", - NULL, "join", tags_2, "tag1,tag2", "bob", "example.com"); + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,irc_tag_key1=value1,irc_tag_key_2;comma=value2;comma," + "irc_tag_key_3_empty=,irc_tag_key_4_null,tag1,tag2,nick_bob," + "host_user@host,log1", + NULL, "privmsg", tags_2, + "tag1,tag2,nick_bob,host_user@host"); + + /* self message */ + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,self_msg,host_user@example.com,log1", + NULL, "privmsg", NULL, "self_msg"); + + /* server + self message */ + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,self_msg,nick_alice,host_user@example.com,log1", + ptr_server, "privmsg", NULL, "self_msg"); + + /* server + self message + host */ + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,self_msg,host_user@host,nick_alice,log1", + ptr_server, "privmsg", NULL, "self_msg,host_user@host"); + + /* server + self message (other nick) + host */ + ctxt.nick_is_me = 0; + WEE_CHECK_PROTOCOL_TAGS( + "irc_privmsg,self_msg,nick_bob,log1", + ptr_server, "privmsg", NULL, "self_msg,nick_bob"); hashtable_free (tags_empty); hashtable_free (tags_1); hashtable_free (tags_2); + + free (ctxt.nick); + free (ctxt.address); } /* @@ -1162,7 +1173,8 @@ TEST(IrcProtocolWithServer, recv_command_not_found) CHECK_ERROR_PARAMS("099", 0, 1); RECV(":alice!user@host 099 abc def"); - CHECK_SRV("--", "abc def", "irc_099,irc_numeric,log3"); + CHECK_SRV("--", "abc def", + "irc_099,irc_numeric,nick_alice,host_user@host,log3"); } /* @@ -1931,23 +1943,25 @@ TEST(IrcProtocolWithServer, fail) CHECK_ERROR_PARAMS("fail", 1, 2); RECV(":server FAIL * TEST"); - CHECK_SRV("=!=", "Failure: [] TEST", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: [] TEST", "irc_fail,nick_server,log3"); RECV(":server FAIL * TEST :the message"); - CHECK_SRV("=!=", "Failure: [TEST] the message", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: [TEST] the message", "irc_fail,nick_server,log3"); RECV(":server FAIL * TEST TEST2"); - CHECK_SRV("=!=", "Failure: [TEST] TEST2", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: [TEST] TEST2", "irc_fail,nick_server,log3"); RECV(":server FAIL * TEST TEST2 :the message"); - CHECK_SRV("=!=", "Failure: [TEST TEST2] the message", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: [TEST TEST2] the message", + "irc_fail,nick_server,log3"); RECV(":server FAIL COMMAND TEST"); - CHECK_SRV("=!=", "Failure: COMMAND [] TEST", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: COMMAND [] TEST", "irc_fail,nick_server,log3"); RECV(":server FAIL COMMAND TEST :the message"); - CHECK_SRV("=!=", "Failure: COMMAND [TEST] the message", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: COMMAND [TEST] the message", + "irc_fail,nick_server,log3"); RECV(":server FAIL COMMAND TEST TEST2"); - CHECK_SRV("=!=", "Failure: COMMAND [TEST] TEST2", "irc_fail,log3"); + CHECK_SRV("=!=", "Failure: COMMAND [TEST] TEST2", "irc_fail,nick_server,log3"); RECV(":server FAIL COMMAND TEST TEST2 :the message"); CHECK_SRV("=!=", "Failure: COMMAND [TEST TEST2] the message", - "irc_fail,log3"); + "irc_fail,nick_server,log3"); } /* @@ -2129,7 +2143,7 @@ TEST(IrcProtocolWithServer, kick) /* kick without a reason */ RECV(":alice!user@host KICK #test bob"); CHECK_CHAN("<--", "alice has kicked bob", - "irc_kick,host_user@host,log3"); + "irc_kick,nick_alice,host_user@host,log3"); STRCMP_EQUAL("alice", ptr_channel->nicks->name); POINTERS_EQUAL(NULL, ptr_channel->nicks->next_nick); @@ -2140,7 +2154,7 @@ TEST(IrcProtocolWithServer, kick) /* with kick a reason */ RECV(":alice!user@host KICK #test bob :no spam here! "); CHECK_CHAN("<--", "alice has kicked bob (no spam here! )", - "irc_kick,host_user@host,log3"); + "irc_kick,nick_alice,host_user@host,log3"); STRCMP_EQUAL("alice", ptr_channel->nicks->name); POINTERS_EQUAL(NULL, ptr_channel->nicks->next_nick); @@ -2151,7 +2165,7 @@ TEST(IrcProtocolWithServer, kick) /* kick of self nick */ RECV(":bob!user@host KICK #test alice :no spam here! "); CHECK_CHAN("<--", "bob has kicked alice (no spam here! )", - "irc_kick,host_user@host,log3"); + "irc_kick,nick_bob,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->nicks); } @@ -2187,7 +2201,7 @@ TEST(IrcProtocolWithServer, kill) /* kill without a reason */ RECV(":bob!user@host KILL alice"); CHECK_CHAN("<--", "You were killed by bob", - "irc_kill,host_user@host,log3"); + "irc_kill,nick_bob,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->nicks); RECV(":alice!user@host JOIN #test"); @@ -2200,7 +2214,7 @@ TEST(IrcProtocolWithServer, kill) /* kill with a reason */ RECV(":bob!user@host KILL alice :killed by admin "); CHECK_CHAN("<--", "You were killed by bob (killed by admin )", - "irc_kill,host_user@host,log3"); + "irc_kill,nick_bob,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->nicks); } @@ -2238,58 +2252,68 @@ TEST(IrcProtocolWithServer, mode) POINTERS_EQUAL(NULL, ptr_channel->modes); /* channel mode */ - RECV(":admin MODE #test +nt"); - CHECK_CHAN("--", "Mode #test [+nt] by admin", "irc_mode,log3"); + 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); /* channel mode removed */ - RECV(":admin MODE #test -n"); - CHECK_CHAN("--", "Mode #test [-n] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE #test -n"); + CHECK_CHAN("--", "Mode #test [-n] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("+t", ptr_channel->modes); /* channel mode removed */ - RECV(":admin MODE #test -t"); - CHECK_CHAN("--", "Mode #test [-t] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE #test -t"); + CHECK_CHAN("--", "Mode #test [-t] by admin", + "irc_mode,nick_admin,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->modes); /* nick mode '@' on channel #test */ - RECV(":admin MODE #test +o alice"); - CHECK_CHAN("--", "Mode #test [+o alice] by admin", "irc_mode,log3"); + 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); STRCMP_EQUAL("@", ptr_nick->prefix); /* another nick mode '+' on channel #test */ - RECV(":admin MODE #test +v alice"); - CHECK_CHAN("--", "Mode #test [+v alice] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE #test +v alice"); + CHECK_CHAN("--", "Mode #test [+v alice] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("@+", ptr_nick->prefixes); STRCMP_EQUAL("@", ptr_nick->prefix); /* nick mode '@' removed on channel #test */ - RECV(":admin MODE #test -o alice"); - CHECK_CHAN("--", "Mode #test [-o alice] by admin", "irc_mode,log3"); + 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); STRCMP_EQUAL("+", ptr_nick->prefix); /* nick mode '+' removed on channel #test */ - RECV(":admin MODE #test -v alice"); - CHECK_CHAN("--", "Mode #test [-v alice] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE #test -v alice"); + CHECK_CHAN("--", "Mode #test [-v alice] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL(" ", ptr_nick->prefixes); STRCMP_EQUAL(" ", ptr_nick->prefix); /* nick mode 'i' */ POINTERS_EQUAL(NULL, ptr_server->nick_modes); - RECV(":admin MODE alice +i"); - CHECK_SRV("--", "User mode [+i] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE alice +i"); + CHECK_SRV("--", "User mode [+i] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("i", ptr_server->nick_modes); /* nick mode 'R' */ - RECV(":admin MODE alice +R"); - CHECK_SRV("--", "User mode [+R] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE alice +R"); + CHECK_SRV("--", "User mode [+R] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("iR", ptr_server->nick_modes); /* remove nick mode 'i' */ - RECV(":admin MODE alice -i"); - CHECK_SRV("--", "User mode [-i] by admin", "irc_mode,log3"); + RECV(":admin!user@host MODE alice -i"); + CHECK_SRV("--", "User mode [-i] by admin", + "irc_mode,nick_admin,host_user@host,log3"); STRCMP_EQUAL("R", ptr_server->nick_modes); } @@ -2333,29 +2357,29 @@ TEST(IrcProtocolWithServer, nick) 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," - "host_user@host,log2"); + "nick_alice,host_user@host,log2"); CHECK_CHAN("--", "You are now known as alice_away", "irc_nick,irc_nick1_alice,irc_nick2_alice_away," - "host_user@host,log2"); + "nick_alice,host_user@host,log2"); STRCMP_EQUAL("alice_away", ptr_nick1->name); /* new nick for alice_away (with ":") */ RECV(":alice_away!user@host NICK :alice2"); CHECK_SRV("--", "You are now known as alice2", "irc_nick,irc_nick1_alice_away,irc_nick2_alice2," - "host_user@host,log2"); + "nick_alice_away,host_user@host,log2"); CHECK_CHAN("--", "You are now known as alice2", "irc_nick,irc_nick1_alice_away,irc_nick2_alice2," - "host_user@host,log2"); + "nick_alice_away,host_user@host,log2"); STRCMP_EQUAL("alice2", ptr_nick1->name); /* new nick for bob */ RECV(":bob!user@host NICK bob_away"); CHECK_CHAN("--", "bob is now known as bob_away", "irc_nick,irc_smart_filter,irc_nick1_bob,irc_nick2_bob_away," - "host_user@host,log2"); + "nick_bob,host_user@host,log2"); CHECK_PV("bob_away", "--", "bob is now known as bob_away", - "irc_nick,irc_nick1_bob,irc_nick2_bob_away,host_user@host," + "irc_nick,irc_nick1_bob,irc_nick2_bob_away,nick_bob,host_user@host," "log2"); STRCMP_EQUAL("bob_away", ptr_nick2->name); @@ -2363,10 +2387,10 @@ TEST(IrcProtocolWithServer, nick) RECV(":bob_away!user@host NICK :bob2"); CHECK_CHAN("--", "bob_away is now known as bob2", "irc_nick,irc_smart_filter,irc_nick1_bob_away," - "irc_nick2_bob2,host_user@host,log2"); + "irc_nick2_bob2,nick_bob_away,host_user@host,log2"); CHECK_PV("bob2", "--", "bob_away is now known as bob2", - "irc_nick,irc_nick1_bob_away,irc_nick2_bob2,host_user@host," - "log2"); + "irc_nick,irc_nick1_bob_away,irc_nick2_bob2," + "nick_bob_away,host_user@host,log2"); STRCMP_EQUAL("bob2", ptr_nick2->name); STRCMP_EQUAL("bob2", ptr_server->last_channel->name); @@ -2390,23 +2414,23 @@ TEST(IrcProtocolWithServer, note) CHECK_ERROR_PARAMS("note", 1, 2); RECV(":server NOTE * TEST"); - CHECK_SRV("--", "Note: [] TEST", "irc_note,log3"); + CHECK_SRV("--", "Note: [] TEST", "irc_note,nick_server,log3"); RECV(":server NOTE * TEST :the message"); - CHECK_SRV("--", "Note: [TEST] the message", "irc_note,log3"); + CHECK_SRV("--", "Note: [TEST] the message", "irc_note,nick_server,log3"); RECV(":server NOTE * TEST TEST2"); - CHECK_SRV("--", "Note: [TEST] TEST2", "irc_note,log3"); + CHECK_SRV("--", "Note: [TEST] TEST2", "irc_note,nick_server,log3"); RECV(":server NOTE * TEST TEST2 :the message"); - CHECK_SRV("--", "Note: [TEST TEST2] the message", "irc_note,log3"); + CHECK_SRV("--", "Note: [TEST TEST2] the message", "irc_note,nick_server,log3"); RECV(":server NOTE COMMAND TEST"); - CHECK_SRV("--", "Note: COMMAND [] TEST", "irc_note,log3"); + CHECK_SRV("--", "Note: COMMAND [] TEST", "irc_note,nick_server,log3"); RECV(":server NOTE COMMAND TEST :the message"); - CHECK_SRV("--", "Note: COMMAND [TEST] the message", "irc_note,log3"); + CHECK_SRV("--", "Note: COMMAND [TEST] the message", "irc_note,nick_server,log3"); RECV(":server NOTE COMMAND TEST TEST2"); - CHECK_SRV("--", "Note: COMMAND [TEST] TEST2", "irc_note,log3"); + CHECK_SRV("--", "Note: COMMAND [TEST] TEST2", "irc_note,nick_server,log3"); RECV(":server NOTE COMMAND TEST TEST2 :the message"); CHECK_SRV("--", "Note: COMMAND [TEST TEST2] the message", - "irc_note,log3"); + "irc_note,nick_server,log3"); } /* @@ -2536,94 +2560,94 @@ TEST(IrcProtocolWithServer, notice) /* broken CTCP to channel */ RECV(":bob!user@host NOTICE #test :\01"); CHECK_SRV("--", "CTCP reply from bob: ", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01TEST"); CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01ACTION"); CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01ACTION is testing"); CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01VERSION"); CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01DCC"); CHECK_SRV("--", "CTCP reply from bob: DCC", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01DCC SEND"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); /* broken CTCP to user */ RECV(":bob!user@host NOTICE alice :\01"); CHECK_SRV("--", "CTCP reply from bob: ", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01TEST"); CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01ACTION"); CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01ACTION is testing"); CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01VERSION"); CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01DCC"); CHECK_SRV("--", "CTCP reply from bob: DCC", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01DCC SEND"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); /* valid CTCP to channel */ RECV(":bob!user@host NOTICE #test :\01TEST\01"); CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01ACTION\01"); CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01ACTION is testing\01"); CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01VERSION\01"); CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3\01"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); /* valid CTCP to user */ RECV(":bob!user@host NOTICE alice :\01TEST\01"); CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01ACTION\01"); CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01ACTION is testing\01"); CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01VERSION\01"); CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); + "irc_notice,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3\01"); CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); + "irc_notice,irc_ctcp,nick_bob,host_user@host,log1"); if (i == 1) hashtable_remove (ptr_server->cap_list, "echo-message"); @@ -2729,13 +2753,13 @@ TEST(IrcProtocolWithServer, pong) SRV_INIT; RECV(":server PONG"); - CHECK_SRV("", "PONG", "irc_pong,log3"); + CHECK_SRV("", "PONG", "irc_pong,nick_server,log3"); RECV(":server PONG server"); - CHECK_SRV("", "PONG", "irc_pong,log3"); + CHECK_SRV("", "PONG", "irc_pong,nick_server,log3"); RECV(":server PONG server :info"); - CHECK_SRV("", "PONG: info", "irc_pong,log3"); + CHECK_SRV("", "PONG: info", "irc_pong,nick_server,log3"); RECV(":server PONG server :extra info"); - CHECK_SRV("", "PONG: extra info", "irc_pong,log3"); + CHECK_SRV("", "PONG: extra info", "irc_pong,nick_server,log3"); } /* @@ -2877,10 +2901,10 @@ TEST(IrcProtocolWithServer, privmsg) /* broken CTCP to channel */ RECV(":bob!user@host PRIVMSG #test :\01"); CHECK_CHAN("--", "Unknown CTCP requested by bob: ", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host PRIVMSG #test :\01TEST"); CHECK_CHAN("--", "Unknown CTCP requested by bob: TEST", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host PRIVMSG #test :\01ACTION"); CHECK_CHAN(" *", "bob", "irc_privmsg,irc_action,notify_message,nick_bob," @@ -2891,14 +2915,14 @@ TEST(IrcProtocolWithServer, privmsg) "host_user@host,log1"); RECV(":bob!user@host PRIVMSG #test :\01VERSION"); CHECK_CHAN("--", "CTCP requested by bob: VERSION", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); info = irc_ctcp_eval_reply (ptr_server, irc_ctcp_get_reply (ptr_server, "VERSION")); snprintf (message, sizeof (message), "CTCP reply to bob: VERSION %s", info); CHECK_CHAN("--", message, "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); + "no_highlight,nick_alice,log1"); snprintf (message, sizeof (message), "NOTICE bob :\01VERSION %s\01", info); CHECK_SENT(message); @@ -2917,10 +2941,10 @@ TEST(IrcProtocolWithServer, privmsg) /* broken CTCP to user */ RECV(":bob!user@host PRIVMSG alice :\01"); CHECK_SRV("--", "Unknown CTCP requested by bob: ", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host PRIVMSG alice :\01TEST"); CHECK_SRV("--", "Unknown CTCP requested by bob: TEST", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); RECV(":bob!user@host PRIVMSG alice :\01ACTION"); CHECK_PV_CLOSE("bob", " *", "bob", "irc_privmsg,irc_action,notify_private,nick_bob," @@ -2936,7 +2960,7 @@ TEST(IrcProtocolWithServer, privmsg) "CTCP reply to bob: VERSION %s", info); CHECK_SRV("--", message, "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); + "no_highlight,nick_alice,log1"); free (info); RECV(":bob!user@host PRIVMSG alice :\01DCC"); CHECK_NO_MSG; @@ -3011,14 +3035,14 @@ TEST(IrcProtocolWithServer, privmsg) CHECK_SENT(NULL); RECV(":bob!user@host PRIVMSG alice :\01VERSION\01"); CHECK_SRV("--", "CTCP requested by bob: VERSION", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_bob,host_user@host,log1"); info = irc_ctcp_eval_reply (ptr_server, irc_ctcp_get_reply (ptr_server, "VERSION")); snprintf (message, sizeof (message), "CTCP reply to bob: VERSION %s", info); CHECK_SRV("--", message, "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); + "no_highlight,nick_alice,log1"); snprintf (message, sizeof (message), "NOTICE bob :\01VERSION %s\01", info); CHECK_SENT(message); @@ -3043,11 +3067,11 @@ TEST(IrcProtocolWithServer, privmsg) if (i == 0) { CHECK_SRV("--", "CTCP requested by alice: CLIENTINFO", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_alice,host_user@host,log1"); CHECK_SRV("--", "CTCP reply to alice: CLIENTINFO ACTION CLIENTINFO " "DCC PING SOURCE TIME VERSION", "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); + "no_highlight,nick_alice,host_user@host,log1"); } else { @@ -3060,11 +3084,11 @@ TEST(IrcProtocolWithServer, privmsg) */ RECV(":alice!user@host PRIVMSG alice :\01CLIENTINFO\01"); CHECK_SRV("--", "CTCP requested by alice: CLIENTINFO", - "irc_privmsg,irc_ctcp,host_user@host,log1"); + "irc_privmsg,irc_ctcp,nick_alice,host_user@host,log1"); CHECK_SRV("--", "CTCP reply to alice: CLIENTINFO ACTION CLIENTINFO " "DCC PING SOURCE TIME VERSION", "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); + "no_highlight,nick_alice,host_user@host,log1"); } /* close xfer buffer */ @@ -3154,13 +3178,13 @@ TEST(IrcProtocolWithServer, setname_without_setname_cap) /* real name of "bob" has changed */ RECV(":bob!user@host SETNAME :new bob realname "); CHECK_CHAN("--", "bob has changed real name to \"new bob realname \"", - "irc_setname,irc_smart_filter,log3"); + "irc_setname,irc_smart_filter,nick_bob,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_nick->realname); /* self real name has changed */ RECV(":alice!user@host SETNAME :new alice realname "); CHECK_SRV("--", "Your real name has been set to \"new alice realname \"", - "irc_setname,log3"); + "irc_setname,nick_alice,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_nick->realname); } @@ -3186,19 +3210,19 @@ TEST(IrcProtocolWithServer, setname_with_setname_cap) /* real name of "bob" has changed */ RECV(":bob!user@host SETNAME :new bob realname "); CHECK_CHAN("--", "bob has changed real name to \"new bob realname \"", - "irc_setname,irc_smart_filter,log3"); + "irc_setname,irc_smart_filter,nick_bob,host_user@host,log3"); STRCMP_EQUAL("new bob realname ", ptr_nick2->realname); /* self real name has changed */ RECV(":alice!user@host SETNAME :new realname"); CHECK_SRV("--", "Your real name has been set to \"new realname\"", - "irc_setname,log3"); + "irc_setname,nick_alice,host_user@host,log3"); STRCMP_EQUAL("new realname", ptr_nick->realname); /* self real name has changed */ RECV(":alice!user@host SETNAME :new realname2"); CHECK_SRV("--", "Your real name has been set to \"new realname2\"", - "irc_setname,log3"); + "irc_setname,nick_alice,host_user@host,log3"); STRCMP_EQUAL("new realname2", ptr_nick->realname); hashtable_remove (ptr_server->cap_list, "setname"); @@ -3288,19 +3312,19 @@ TEST(IrcProtocolWithServer, topic) /* empty topic */ RECV(":alice!user@host TOPIC #test"); CHECK_CHAN("--", "alice has unset topic for #test", - "irc_topic,host_user@host,log3"); + "irc_topic,nick_alice,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->topic); /* empty topic (with empty trailing parameter) */ RECV(":alice!user@host TOPIC #test :"); CHECK_CHAN("--", "alice has unset topic for #test", - "irc_topic,host_user@host,log3"); + "irc_topic,nick_alice,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->topic); /* new topic */ RECV(":alice!user@host TOPIC #test :new topic "); CHECK_CHAN("--", "alice has changed topic for #test to \"new topic \"", - "irc_topic,host_user@host,log3"); + "irc_topic,nick_alice,host_user@host,log3"); STRCMP_EQUAL("new topic ", ptr_channel->topic); /* another new topic */ @@ -3308,7 +3332,7 @@ TEST(IrcProtocolWithServer, topic) CHECK_CHAN("--", "alice has changed topic for #test from \"new topic \" to " "\"another new topic \"", - "irc_topic,host_user@host,log3"); + "irc_topic,nick_alice,host_user@host,log3"); STRCMP_EQUAL("another new topic ", ptr_channel->topic); /* empty topic */ @@ -3316,7 +3340,7 @@ TEST(IrcProtocolWithServer, topic) CHECK_CHAN("--", "alice has unset topic for #test (old topic: " "\"another new topic \")", - "irc_topic,host_user@host,log3"); + "irc_topic,nick_alice,host_user@host,log3"); POINTERS_EQUAL(NULL, ptr_channel->topic); } @@ -3360,23 +3384,23 @@ TEST(IrcProtocolWithServer, warn) CHECK_ERROR_PARAMS("warn", 1, 2); RECV(":server WARN * TEST"); - CHECK_SRV("=!=", "Warning: [] TEST", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: [] TEST", "irc_warn,nick_server,log3"); RECV(":server WARN * TEST :the message"); - CHECK_SRV("=!=", "Warning: [TEST] the message", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: [TEST] the message", "irc_warn,nick_server,log3"); RECV(":server WARN * TEST TEST2"); - CHECK_SRV("=!=", "Warning: [TEST] TEST2", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: [TEST] TEST2", "irc_warn,nick_server,log3"); RECV(":server WARN * TEST TEST2 :the message"); - CHECK_SRV("=!=", "Warning: [TEST TEST2] the message", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: [TEST TEST2] the message", "irc_warn,nick_server,log3"); RECV(":server WARN COMMAND TEST"); - CHECK_SRV("=!=", "Warning: COMMAND [] TEST", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: COMMAND [] TEST", "irc_warn,nick_server,log3"); RECV(":server WARN COMMAND TEST :the message"); - CHECK_SRV("=!=", "Warning: COMMAND [TEST] the message", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: COMMAND [TEST] the message", "irc_warn,nick_server,log3"); RECV(":server WARN COMMAND TEST TEST2"); - CHECK_SRV("=!=", "Warning: COMMAND [TEST] TEST2", "irc_warn,log3"); + CHECK_SRV("=!=", "Warning: COMMAND [TEST] TEST2", "irc_warn,nick_server,log3"); RECV(":server WARN COMMAND TEST TEST2 :the message"); CHECK_SRV("=!=", "Warning: COMMAND [TEST TEST2] the message", - "irc_warn,log3"); + "irc_warn,nick_server,log3"); } /* @@ -3394,7 +3418,7 @@ TEST(IrcProtocolWithServer, 001_empty) CHECK_ERROR_PARAMS("001", 0, 1); RECV(":server 001 alice"); - CHECK_SRV("--", "", "irc_001,irc_numeric,log3"); + CHECK_SRV("--", "", "irc_001,irc_numeric,nick_server,log3"); LONGS_EQUAL(1, ptr_server->is_connected); STRCMP_EQUAL("alice", ptr_server->nick); } @@ -3414,7 +3438,7 @@ TEST(IrcProtocolWithServer, 001_welcome) RECV(":server 001 alice :Welcome on this server, alice!"); CHECK_SRV("--", "Welcome on this server, alice!", - "irc_001,irc_numeric,log3"); + "irc_001,irc_numeric,nick_server,log3"); LONGS_EQUAL(1, ptr_server->is_connected); STRCMP_EQUAL("alice", ptr_server->nick); @@ -3435,7 +3459,7 @@ TEST(IrcProtocolWithServer, 005_empty) POINTERS_EQUAL(NULL, ptr_server->prefix_chars); RECV(":server 005 alice TEST=A"); - CHECK_SRV("--", "TEST=A", "irc_005,irc_numeric,log3"); + CHECK_SRV("--", "TEST=A", "irc_005,irc_numeric,nick_server,log3"); POINTERS_EQUAL(NULL, ptr_server->prefix_modes); POINTERS_EQUAL(NULL, ptr_server->prefix_chars); @@ -3466,7 +3490,7 @@ TEST(IrcProtocolWithServer, 005_full) RECV(":server 005 alice " IRC_MSG_005 " :are supported"); CHECK_SRV("--", IRC_MSG_005 " are supported", - "irc_005,irc_numeric,log3"); + "irc_005,irc_numeric,nick_server,log3"); STRCMP_EQUAL("ohv", ptr_server->prefix_modes); STRCMP_EQUAL("@%+", ptr_server->prefix_chars); @@ -3485,7 +3509,7 @@ TEST(IrcProtocolWithServer, 005_full) /* check that realloc of info is OK if we receive the message again */ RECV(":server 005 alice " IRC_MSG_005 " :are supported"); CHECK_SRV("--", IRC_MSG_005 " are supported", - "irc_005,irc_numeric,log3"); + "irc_005,irc_numeric,nick_server,log3"); STRCMP_EQUAL("ohv", ptr_server->prefix_modes); STRCMP_EQUAL("@%+", ptr_server->prefix_chars); @@ -3518,14 +3542,14 @@ TEST(IrcProtocolWithServer, 005_multiple_messages) RECV(":server 005 alice PREFIX=(ohv)@%+ :are supported"); CHECK_SRV("--", "PREFIX=(ohv)@%+ are supported", - "irc_005,irc_numeric,log3"); + "irc_005,irc_numeric,nick_server,log3"); STRCMP_EQUAL("ohv", ptr_server->prefix_modes); STRCMP_EQUAL("@%+", ptr_server->prefix_chars); STRCMP_EQUAL("PREFIX=(ohv)@%+", ptr_server->isupport); RECV(":server 005 alice HOSTLEN=24 :are supported"); CHECK_SRV("--", "HOSTLEN=24 are supported", - "irc_005,irc_numeric,log3"); + "irc_005,irc_numeric,nick_server,log3"); LONGS_EQUAL(24, ptr_server->host_max_length); STRCMP_EQUAL("PREFIX=(ohv)@%+ HOSTLEN=24", ptr_server->isupport); } @@ -3548,7 +3572,7 @@ TEST(IrcProtocolWithServer, 008) RECV(":server 008 alice +Zbfkrsuy :Server notice mask"); CHECK_SRV("--", "Server notice mask for alice: +Zbfkrsuy Server notice mask", - "irc_008,irc_numeric,log3"); + "irc_008,irc_numeric,nick_server,log3"); } /* @@ -3570,12 +3594,12 @@ TEST(IrcProtocolWithServer, 221) RECV(":server 221 alice :+abc"); CHECK_SRV("--", "User mode for alice is [+abc]", - "irc_221,irc_numeric,log3"); + "irc_221,irc_numeric,nick_server,log3"); STRCMP_EQUAL("abc", ptr_server->nick_modes); RECV(":server 221 alice :-abc"); CHECK_SRV("--","User mode for alice is [-abc]", - "irc_221,irc_numeric,log3"); + "irc_221,irc_numeric,nick_server,log3"); POINTERS_EQUAL(NULL, ptr_server->nick_modes); } @@ -3668,72 +3692,72 @@ TEST(IrcProtocolWithServer, whois_nick_msg) CHECK_ERROR_PARAMS("671", 1, 2); RECV(":server 223 alice bob UTF-8"); - CHECK_SRV("--", "[bob] UTF-8", "irc_223,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] UTF-8", "irc_223,irc_numeric,nick_server,log3"); RECV(":server 223 alice bob"); - CHECK_SRV("--", "bob", "irc_223,irc_numeric,log3"); + 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", - "irc_264,irc_numeric,log3"); + "irc_264,irc_numeric,nick_server,log3"); RECV(":server 264 alice bob"); - CHECK_SRV("--", "bob", "irc_264,irc_numeric,log3"); + 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", - "irc_275,irc_numeric,log3"); + "irc_275,irc_numeric,nick_server,log3"); RECV(":server 275 alice bob"); - CHECK_SRV("--", "bob", "irc_275,irc_numeric,log3"); + 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", - "irc_276,irc_numeric,log3"); + "irc_276,irc_numeric,nick_server,log3"); RECV(":server 276 alice bob"); - CHECK_SRV("--", "bob", "irc_276,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] registered nick", "irc_307,irc_numeric,nick_server,log3"); RECV(":server 307 alice bob"); - CHECK_SRV("--", "bob", "irc_307,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] help mode", "irc_310,irc_numeric,nick_server,log3"); RECV(":server 310 alice bob"); - CHECK_SRV("--", "bob", "irc_310,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_310,irc_numeric,nick_server,log3"); RECV(":server 313 alice bob :operator"); - CHECK_SRV("--", "[bob] operator", "irc_313,irc_numeric,log3"); + CHECK_SRV("--", "[bob] operator", "irc_313,irc_numeric,nick_server,log3"); RECV(":server 313 alice bob"); - CHECK_SRV("--", "bob", "irc_313,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_313,irc_numeric,nick_server,log3"); RECV(":server 318 alice bob :end"); - CHECK_SRV("--", "[bob] end", "irc_318,irc_numeric,log3"); + CHECK_SRV("--", "[bob] end", "irc_318,irc_numeric,nick_server,log3"); RECV(":server 318 alice bob"); - CHECK_SRV("--", "bob", "irc_318,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_318,irc_numeric,nick_server,log3"); RECV(":server 319 alice bob :channels"); - CHECK_SRV("--", "[bob] channels", "irc_319,irc_numeric,log3"); + CHECK_SRV("--", "[bob] channels", "irc_319,irc_numeric,nick_server,log3"); RECV(":server 319 alice bob"); - CHECK_SRV("--", "bob", "irc_319,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] identified user", "irc_320,irc_numeric,nick_server,log3"); RECV(":server 320 alice bob"); - CHECK_SRV("--", "bob", "irc_320,irc_numeric,log3"); + 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,log3"); + 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,log3"); + 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,log3"); + 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,log3"); + CHECK_SRV("--", "bob", "irc_335,irc_numeric,nick_server,log3"); RECV(":server 378 alice bob"); - CHECK_SRV("--", "bob", "irc_378,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] connecting from", "irc_378,irc_numeric,nick_server,log3"); RECV(":server 378 alice bob"); - CHECK_SRV("--", "bob", "irc_378,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] using modes", "irc_379,irc_numeric,nick_server,log3"); RECV(":server 379 alice bob"); - CHECK_SRV("--", "bob", "irc_379,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] secure connection", "irc_671,irc_numeric,nick_server,log3"); RECV(":server 671 alice bob"); - CHECK_SRV("--", "bob", "irc_671,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_671,irc_numeric,nick_server,log3"); } /* @@ -3755,11 +3779,11 @@ TEST(IrcProtocolWithServer, whowas_nick_msg) CHECK_ERROR_PARAMS("369", 1, 2); RECV(":server 369 alice bob end"); - CHECK_SRV("--", "[bob] end", "irc_369,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "[bob] end", "irc_369,irc_numeric,nick_server,log3"); RECV(":server 369 alice bob"); - CHECK_SRV("--", "bob", "irc_369,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_369,irc_numeric,nick_server,log3"); } /* @@ -3788,7 +3812,7 @@ TEST(IrcProtocolWithServer, 301) RECV(":server 301 alice bob :I am away "); CHECK_PV("bob", "--", "[bob] is away: I am away ", - "irc_301,irc_numeric,log3"); + "irc_301,irc_numeric,nick_server,log3"); STRCMP_EQUAL("I am away ", ptr_server->channels->away_message); } @@ -3809,7 +3833,7 @@ TEST(IrcProtocolWithServer, 303) RECV(":server 303 alice :nick1 nick2"); CHECK_SRV("--", "Users online: nick1 nick2", - "irc_303,irc_numeric,log3"); + "irc_303,irc_numeric,nick_server,log3"); } /* @@ -3844,12 +3868,12 @@ TEST(IrcProtocolWithServer, 305_306) 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,log3"); + 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?", - "irc_305,irc_numeric,log3"); + "irc_305,irc_numeric,nick_server,log3"); LONGS_EQUAL(0, ptr_server->is_away); } @@ -3873,12 +3897,12 @@ TEST(IrcProtocolWithServer, 311) /* non-standard parameters (using default whois callback) */ RECV(":server 311 alice bob user"); - CHECK_SRV("--", "[bob] user", "irc_311,irc_numeric,log3"); + 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", - "irc_311,irc_numeric,log3"); + "irc_311,irc_numeric,nick_server,log3"); } /* @@ -3900,12 +3924,12 @@ TEST(IrcProtocolWithServer, 312) /* non-standard parameters (using default whois callback) */ RECV(":server 312 alice bob server"); - CHECK_SRV("--", "[bob] server", "irc_312,irc_numeric,log3"); + 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,log3"); + "irc_312,irc_numeric,nick_server,log3"); } /* @@ -3927,12 +3951,12 @@ TEST(IrcProtocolWithServer, 314) /* non-standard parameters (using default whowas callback) */ RECV(":server 314 alice bob user"); - CHECK_SRV("--", "[bob] user", "irc_314,irc_numeric,log3"); + 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", - "irc_314,irc_numeric,log3"); + "irc_314,irc_numeric,nick_server,log3"); } /* @@ -3954,7 +3978,7 @@ TEST(IrcProtocolWithServer, 315) RECV(":server 315 alice #test End of /WHO list."); CHECK_SRV("--", "[#test] End of /WHO list.", - "irc_315,irc_numeric,log3"); + "irc_315,irc_numeric,nick_server,log3"); } /* @@ -3984,12 +4008,12 @@ TEST(IrcProtocolWithServer, 317) CHECK_SRV("--", "[bob] idle: 1 day, 10 hours 07 minutes 57 seconds, " "signon at: Wed, 12 Mar 2008 13:18:00", - "irc_317,irc_numeric,log3"); + "irc_317,irc_numeric,nick_server,log3"); 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", - "irc_317,irc_numeric,log3"); + "irc_317,irc_numeric,nick_server,log3"); /* signon 2 minutes ago */ time = time_t (NULL); @@ -4016,11 +4040,11 @@ TEST(IrcProtocolWithServer, 321) CHECK_ERROR_PARAMS("321", 1, 2); RECV(":server 321 alice #test"); - CHECK_SRV("--", "#test", "irc_321,irc_numeric,log3"); + CHECK_SRV("--", "#test", "irc_321,irc_numeric,nick_server,log3"); RECV(":server 321 alice #test Users"); - CHECK_SRV("--", "#test Users", "irc_321,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "#test Users Name", "irc_321,irc_numeric,nick_server,log3"); } /* @@ -4041,21 +4065,21 @@ TEST(IrcProtocolWithServer, 322) CHECK_ERROR_PARAMS("322", 2, 3); RECV(":server 322 alice #test 3"); - CHECK_SRV("--", "#test(3)", "irc_322,irc_numeric,log3"); + CHECK_SRV("--", "#test(3)", "irc_322,irc_numeric,nick_server,log3"); RECV(":server 322 alice #test 3 :topic of channel "); CHECK_SRV("--", "#test(3): topic of channel ", - "irc_322,irc_numeric,log3"); + "irc_322,irc_numeric,nick_server,log3"); run_cmd_quiet ("/list -server " IRC_FAKE_SERVER " -re #test.*"); CHECK_SRV("--", "#test(3): topic of channel ", - "irc_322,irc_numeric,log3"); + "irc_322,irc_numeric,nick_server,log3"); RECV(":server 322 alice #test 3"); CHECK_SRV("--", "#test(3)", - "irc_322,irc_numeric,log3"); + "irc_322,irc_numeric,nick_server,log3"); RECV(":server 322 alice #test 3 :topic of channel "); CHECK_SRV("--", "#test(3): topic of channel ", - "irc_322,irc_numeric,log3"); + "irc_322,irc_numeric,nick_server,log3"); RECV(":server 322 alice #xyz 3"); CHECK_NO_MSG; @@ -4077,11 +4101,11 @@ TEST(IrcProtocolWithServer, 323) CHECK_ERROR_PARAMS("323", 0, 1); RECV(":server 323 alice"); - CHECK_SRV("--", "", "irc_323,irc_numeric,log3"); + CHECK_SRV("--", "", "irc_323,irc_numeric,nick_server,log3"); RECV(":server 323 alice end"); - CHECK_SRV("--", "end", "irc_323,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "End of /LIST", "irc_323,irc_numeric,nick_server,log3"); } /* @@ -4106,7 +4130,7 @@ TEST(IrcProtocolWithServer, 324) STRCMP_EQUAL("+nt", ptr_server->channels->modes); RECV(":server 324 alice #test"); - CHECK_CHAN("--", "Mode #test []", "irc_324,irc_numeric,log3"); + CHECK_CHAN("--", "Mode #test []", "irc_324,irc_numeric,nick_server,log3"); POINTERS_EQUAL(NULL, ptr_server->channels->modes); } @@ -4129,14 +4153,14 @@ TEST(IrcProtocolWithServer, 327) /* non-standard parameters (using default whois callback) */ RECV(":server 327 alice bob host"); - CHECK_SRV("--", "[bob] host", "irc_327,irc_numeric,log3"); + CHECK_SRV("--", "[bob] host", "irc_327,irc_numeric,nick_server,log3"); /* standard parameters */ RECV(":server 327 alice bob host 1.2.3.4"); - CHECK_SRV("--", "[bob] host 1.2.3.4", "irc_327,irc_numeric,log3"); + 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)", - "irc_327,irc_numeric,log3"); + "irc_327,irc_numeric,nick_server,log3"); } /* @@ -4158,10 +4182,10 @@ TEST(IrcProtocolWithServer, 328) RECV(":server 328 alice #test :https://example.com/"); CHECK_CHAN("--", "URL for #test: https://example.com/", - "irc_328,irc_numeric,log3"); + "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/", - "irc_328,irc_numeric,log3"); + "irc_328,irc_numeric,nick_server,log3"); } /* @@ -4183,18 +4207,18 @@ TEST(IrcProtocolWithServer, 329) RECV(":server 329 alice #test 1205327894"); CHECK_CHAN("--", "Channel created on Wed, 12 Mar 2008 13:18:14", - "irc_329,irc_numeric,log3"); + "irc_329,irc_numeric,nick_server,log3"); RECV(":server 329 alice #test :1205327894"); CHECK_CHAN("--", "Channel created on Wed, 12 Mar 2008 13:18:14", - "irc_329,irc_numeric,log3"); + "irc_329,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 329 alice #xyz 1205327894"); CHECK_SRV("--", "Channel #xyz created on Wed, 12 Mar 2008 13:18:14", - "irc_329,irc_numeric,log3"); + "irc_329,irc_numeric,nick_server,log3"); RECV(":server 329 alice #xyz :1205327894"); CHECK_SRV("--", "Channel #xyz created on Wed, 12 Mar 2008 13:18:14", - "irc_329,irc_numeric,log3"); + "irc_329,irc_numeric,nick_server,log3"); } /* @@ -4224,15 +4248,16 @@ TEST(IrcProtocolWithServer, 330_343) CHECK_ERROR_PARAMS("343", 2, 3); RECV(":server 330 alice bob bob2"); - CHECK_SRV("--", "[bob] bob2", "irc_330,irc_numeric,log3"); + 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", - "irc_330,irc_numeric,log3"); + "irc_330,irc_numeric,nick_server,log3"); RECV(":server 343 alice bob bob2"); - CHECK_SRV("--", "[bob] bob2", "irc_343,irc_numeric,log3"); + 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", "irc_343,irc_numeric,log3"); + CHECK_SRV("--", "[bob] is opered as bob2", + "irc_343,irc_numeric,nick_server,log3"); } /* @@ -4252,12 +4277,12 @@ TEST(IrcProtocolWithServer, 331) RECV(":server 331 alice #test"); CHECK_CHAN("--", "No topic set for channel #test", - "irc_331,irc_numeric,log3"); + "irc_331,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 331 alice #xyz"); CHECK_SRV("--", "No topic set for channel #xyz", - "irc_331,irc_numeric,log3"); + "irc_331,irc_numeric,nick_server,log3"); } /* @@ -4279,11 +4304,11 @@ TEST(IrcProtocolWithServer, 332) RECV(":server 332 alice #test"); CHECK_CHAN("--", "Topic for #test is \"\"", - "irc_332,irc_numeric,log3"); + "irc_332,irc_numeric,nick_server,log3"); RECV(":server 332 alice #test :the new topic "); CHECK_CHAN("--", "Topic for #test is \"the new topic \"", - "irc_332,irc_numeric,log3"); + "irc_332,irc_numeric,nick_server,log3"); STRCMP_EQUAL("the new topic ", ptr_server->channels->topic); } @@ -4309,10 +4334,10 @@ TEST(IrcProtocolWithServer, 333) RECV(":server 333 alice #test nick!user@host 1205428096"); CHECK_CHAN("--", "Topic set by nick (user@host) on Thu, 13 Mar 2008 17:08:16", - "irc_333,irc_numeric,log3"); + "irc_333,irc_numeric,nick_server,log3"); RECV(":server 333 alice #test 1205428096"); CHECK_CHAN("--", "Topic set on Thu, 13 Mar 2008 17:08:16", - "irc_333,irc_numeric,log3"); + "irc_333,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 333 alice #xyz nick!user@host"); @@ -4321,10 +4346,10 @@ TEST(IrcProtocolWithServer, 333) CHECK_SRV("--", "Topic for #xyz set by nick (user@host) on " "Thu, 13 Mar 2008 17:08:16", - "irc_333,irc_numeric,log3"); + "irc_333,irc_numeric,nick_server,log3"); RECV(":server 333 alice #xyz 1205428096"); CHECK_SRV("--", "Topic for #xyz set on Thu, 13 Mar 2008 17:08:16", - "irc_333,irc_numeric,log3"); + "irc_333,irc_numeric,nick_server,log3"); } /* @@ -4346,12 +4371,12 @@ TEST(IrcProtocolWithServer, 338) RECV(":server 338 alice bob hostname :actually using host"); CHECK_SRV("--", "[bob] actually using host hostname", - "irc_338,irc_numeric,log3"); + "irc_338,irc_numeric,nick_server,log3"); /* on Rizon server */ RECV(":server 338 alice bob :is actually bob@example.com [1.2.3.4]"); CHECK_SRV("--", "[bob] is actually bob@example.com [1.2.3.4]", - "irc_338,irc_numeric,log3"); + "irc_338,irc_numeric,nick_server,log3"); } /* @@ -4399,28 +4424,28 @@ TEST(IrcProtocolWithServer, 344) /* channel reop (IRCnet) */ RECV(":server 344 alice #test nick!user@host"); CHECK_SRV("--", "Channel reop #test: nick!user@host", - "irc_344,irc_numeric,log3"); + "irc_344,irc_numeric,nick_server,log3"); RECV(":server 344 alice #test :nick!user@host"); CHECK_SRV("--", "Channel reop #test: nick!user@host", - "irc_344,irc_numeric,log3"); + "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,log3"); + "irc_344,irc_numeric,nick_server,log3"); RECV(":server 344 alice #xyz :nick!user@host"); CHECK_SRV("--", "Channel reop #xyz: nick!user@host", - "irc_344,irc_numeric,log3"); + "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)", - "irc_344,irc_numeric,log3"); + "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", - "irc_344,irc_numeric,log3"); + "irc_344,irc_numeric,nick_server,log3"); } /* @@ -4441,17 +4466,17 @@ TEST(IrcProtocolWithServer, 345) CHECK_ERROR_PARAMS("345", 2, 3); RECV(":server 345 alice #test end"); - CHECK_SRV("--", "#test: end", "irc_345,irc_numeric,log3"); + 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", - "irc_345,irc_numeric,log3"); + "irc_345,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 345 alice #xyz end"); - CHECK_SRV("--", "#xyz: end", "irc_345,irc_numeric,log3"); + CHECK_SRV("--", "#xyz: end", "irc_345,irc_numeric,nick_server,log3"); RECV(":server 345 alice #xyz :End of Channel Reop List"); CHECK_SRV("--", "#xyz: End of Channel Reop List", - "irc_345,irc_numeric,log3"); + "irc_345,irc_numeric,nick_server,log3"); } /* @@ -4473,28 +4498,28 @@ TEST(IrcProtocolWithServer, 346) RECV(":server 346 alice #test invitemask"); CHECK_CHAN("--", "[#test] [1] invitemask invited", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); RECV(":server 346 alice #test invitemask nick!user@host"); CHECK_CHAN("--", "[#test] [2] invitemask invited by nick (user@host)", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); 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", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 346 alice #xyz invitemask"); CHECK_SRV("--", "[#xyz] invitemask invited", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); RECV(":server 346 alice #xyz invitemask nick!user@host"); CHECK_SRV("--", "[#xyz] invitemask invited by nick (user@host)", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); RECV(":server 346 alice #xyz invitemask nick!user@host 1205590879"); CHECK_SRV("--", "[#xyz] invitemask invited by nick (user@host) " "on Sat, 15 Mar 2008 14:21:19", - "irc_346,irc_numeric,log3"); + "irc_346,irc_numeric,nick_server,log3"); } /* @@ -4513,21 +4538,21 @@ TEST(IrcProtocolWithServer, 347) CHECK_ERROR_PARAMS("347", 1, 2); RECV(":server 347 alice #test"); - CHECK_CHAN("--", "[#test]", "irc_347,irc_numeric,log3"); + CHECK_CHAN("--", "[#test]", "irc_347,irc_numeric,nick_server,log3"); RECV(":server 347 alice #test end"); - CHECK_CHAN("--", "[#test] end", "irc_347,irc_numeric,log3"); + 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", - "irc_347,irc_numeric,log3"); + "irc_347,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 347 alice #xyz"); - CHECK_SRV("--", "[#xyz]", "irc_347,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz]", "irc_347,irc_numeric,nick_server,log3"); RECV(":server 347 alice #xyz end"); - CHECK_SRV("--", "[#xyz] end", "irc_347,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz] end", "irc_347,irc_numeric,nick_server,log3"); RECV(":server 347 alice #xyz :End of Channel Invite List"); CHECK_SRV("--", "[#xyz] End of Channel Invite List", - "irc_347,irc_numeric,log3"); + "irc_347,irc_numeric,nick_server,log3"); } /* @@ -4549,34 +4574,34 @@ TEST(IrcProtocolWithServer, 348) RECV(":server 348 alice #test nick1!user1@host1"); CHECK_CHAN("--", "[#test] [1] exception nick1!user1@host1", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); RECV(":server 348 alice #test nick1!user1@host1 nick2!user2@host2"); CHECK_CHAN("--", "[#test] [2] exception nick1!user1@host1 " "by nick2 (user2@host2)", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); RECV(":server 348 alice #test nick1!user1@host1 nick2!user2@host2 " "1205585109"); CHECK_CHAN("--", "[#test] [3] exception nick1!user1@host1 " "by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 348 alice #xyz nick1!user1@host1"); CHECK_SRV("--", "[#xyz] exception nick1!user1@host1", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); RECV(":server 348 alice #xyz nick1!user1@host1 nick2!user2@host2"); CHECK_SRV("--", "[#xyz] exception nick1!user1@host1 " "by nick2 (user2@host2)", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); RECV(":server 348 alice #xyz nick1!user1@host1 nick2!user2@host2 " "1205585109"); CHECK_SRV("--", "[#xyz] exception nick1!user1@host1 " "by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", - "irc_348,irc_numeric,log3"); + "irc_348,irc_numeric,nick_server,log3"); } /* @@ -4595,21 +4620,21 @@ TEST(IrcProtocolWithServer, 349) CHECK_ERROR_PARAMS("349", 1, 2); RECV(":server 349 alice #test"); - CHECK_CHAN("--", "[#test]", "irc_349,irc_numeric,log3"); + CHECK_CHAN("--", "[#test]", "irc_349,irc_numeric,nick_server,log3"); RECV(":server 349 alice #test end"); - CHECK_CHAN("--", "[#test] end", "irc_349,irc_numeric,log3"); + 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", - "irc_349,irc_numeric,log3"); + "irc_349,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 349 alice #xyz"); - CHECK_SRV("--", "[#xyz]", "irc_349,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz]", "irc_349,irc_numeric,nick_server,log3"); RECV(":server 349 alice #xyz end"); - CHECK_SRV("--", "[#xyz] end", "irc_349,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz] end", "irc_349,irc_numeric,nick_server,log3"); RECV(":server 349 alice #xyz :End of Channel Exception List"); CHECK_SRV("--", "[#xyz] End of Channel Exception List", - "irc_349,irc_numeric,log3"); + "irc_349,irc_numeric,nick_server,log3"); } @@ -4630,28 +4655,30 @@ TEST(IrcProtocolWithServer, 350) /* non-standard parameters (using whois_nick_msg callback) */ RECV(":server 350 alice bob :something here"); - CHECK_SRV("--", "[bob] something here", "irc_350,irc_numeric,log3"); + CHECK_SRV("--", "[bob] something here", + "irc_350,irc_numeric,nick_server,log3"); RECV(":server 350 alice bob * :something here"); - CHECK_SRV("--", "[bob] * something here", "irc_350,irc_numeric,log3"); + CHECK_SRV("--", "[bob] * something here", + "irc_350,irc_numeric,nick_server,log3"); /* non-standard parameters (using default whois callback) */ RECV(":server 350 alice bob"); - CHECK_SRV("--", "bob", "irc_350,irc_numeric,log3"); + 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", - "irc_350,irc_numeric,log3"); + "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", - "irc_350,irc_numeric,log3"); + "irc_350,irc_numeric,nick_server,log3"); RECV(":server 350 alice bob * 1.2.3.4 :is connected via the WebIRC gateway"); CHECK_SRV("--", "[bob] (1.2.3.4) is connected via the WebIRC gateway", - "irc_350,irc_numeric,log3"); + "irc_350,irc_numeric,nick_server,log3"); RECV(":server 350 alice bob example.com 1.2.3.4 :is connected via the WebIRC gateway"); CHECK_SRV("--", "[bob] (example.com, 1.2.3.4) is connected via the WebIRC gateway", - "irc_350,irc_numeric,log3"); + "irc_350,irc_numeric,nick_server,log3"); } /* @@ -4672,10 +4699,11 @@ TEST(IrcProtocolWithServer, 351) CHECK_ERROR_PARAMS("351", 2, 3); RECV(":server 351 alice dancer-ircd-1.0 server"); - CHECK_SRV("--", "dancer-ircd-1.0 server", "irc_351,irc_numeric,log3"); + 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)", - "irc_351,irc_numeric,log3"); + "irc_351,irc_numeric,nick_server,log3"); } /* @@ -4717,56 +4745,56 @@ TEST(IrcProtocolWithServer, 352) RECV(":server 352 alice #test user2 host2 server bob"); CHECK_SRV("--", "[#test] bob (user2@host2) ()", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user2@host2", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->realname); RECV(":server 352 alice #test user3 host3 server bob *"); CHECK_SRV("--", "[#test] bob (user3@host3) * ()", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user3@host3", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_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)", - "irc_352,irc_numeric,log3"); + "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); 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)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user5@host5", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("real name 2", ptr_nick2->realname); RECV(":server 352 alice #test user6 host6 server bob G@ :0 real name 3"); CHECK_SRV("--", "[#test] bob (user6@host6) G@ 0 (real name 3)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user6@host6", ptr_nick2->host); LONGS_EQUAL(1, ptr_nick2->away); STRCMP_EQUAL("real name 3", ptr_nick2->realname); RECV(":server 352 alice #test user7 host7 server bob * :0 real name 4"); CHECK_SRV("--", "[#test] bob (user7@host7) * 0 (real name 4)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user7@host7", ptr_nick2->host); LONGS_EQUAL(1, ptr_nick2->away); STRCMP_EQUAL("real name 4", ptr_nick2->realname); RECV(":server 352 alice #test user8 host8 server bob H@ :0 real name 5"); CHECK_SRV("--", "[#test] bob (user8@host8) H@ 0 (real name 5)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user8@host8", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("real name 5", ptr_nick2->realname); RECV(":server 352 alice #test user8 host8 server bob H@ :0"); CHECK_SRV("--", "[#test] bob (user8@host8) H@ 0 ()", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user8@host8", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("real name 5", ptr_nick2->realname); @@ -4785,19 +4813,19 @@ TEST(IrcProtocolWithServer, 352) CHECK_NO_MSG; RECV(":server 352 alice #xyz user host server bob"); CHECK_SRV("--", "[#xyz] bob (user@host) ()", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); RECV(":server 352 alice #xyz user host server bob *"); CHECK_SRV("--", "[#xyz] bob (user@host) * ()", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); RECV(":server 352 alice #xyz user host server bob * :0 nick"); CHECK_SRV("--", "[#xyz] bob (user@host) * 0 (nick)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); RECV(":server 352 alice #xyz user host server bob H@ :0 nick"); CHECK_SRV("--", "[#xyz] bob (user@host) H@ 0 (nick)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); RECV(":server 352 alice #xyz user host server bob G@ :0 nick"); CHECK_SRV("--", "[#xyz] bob (user@host) G@ 0 (nick)", - "irc_352,irc_numeric,log3"); + "irc_352,irc_numeric,nick_server,log3"); } /* @@ -4887,17 +4915,19 @@ TEST(IrcProtocolWithServer, 353) /* channel not found */ RECV(":server 353 alice #xyz :alice"); - CHECK_SRV("--", "Nicks #xyz: [alice]", "irc_353,irc_numeric,log3"); + CHECK_SRV("--", "Nicks #xyz: [alice]", + "irc_353,irc_numeric,nick_server,log3"); RECV(":server 353 alice #xyz :alice bob @carol +dan!user@host"); CHECK_SRV("--", "Nicks #xyz: [alice bob @carol +dan]", - "irc_353,irc_numeric,log3"); + "irc_353,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 353 alice = #xyz :alice"); - CHECK_SRV("--", "Nicks #xyz: [alice]", "irc_353,irc_numeric,log3"); + CHECK_SRV("--", "Nicks #xyz: [alice]", + "irc_353,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #xyz :alice bob @carol +dan!user@host"); CHECK_SRV("--", "Nicks #xyz: [alice bob @carol +dan]", - "irc_353,irc_numeric,log3"); + "irc_353,irc_numeric,nick_server,log3"); } /* @@ -4933,14 +4963,14 @@ TEST(IrcProtocolWithServer, 354) POINTERS_EQUAL(NULL, ptr_nick2->realname); RECV(":server 354 alice #test"); - CHECK_SRV("--", "[#test]", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#test]", "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); POINTERS_EQUAL(NULL, ptr_nick2->realname); RECV(":server 354 alice #test user2"); - CHECK_SRV("--", "[#test] user2", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#test] user2", "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4948,14 +4978,14 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 :trailing parameter"); CHECK_SRV("--", "[#test] user2 trailing parameter", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); POINTERS_EQUAL(NULL, ptr_nick2->realname); RECV(":server 354 alice #test user2 host2"); - CHECK_SRV("--", "[#test] user2 host2", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#test] user2 host2", "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4963,7 +4993,7 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 host2 server"); CHECK_SRV("--", "[#test] user2 host2 server", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4971,7 +5001,7 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 host2 server bob"); CHECK_SRV("--", "[#test] user2 host2 server bob", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4979,7 +5009,7 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 host2 server bob *"); CHECK_SRV("--", "[#test] user2 host2 server bob *", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4987,7 +5017,7 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 host2 server bob H@ 0"); CHECK_SRV("--", "[#test] user2 host2 server bob H@ 0", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user_b@host_b", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); POINTERS_EQUAL(NULL, ptr_nick2->account); @@ -4995,7 +5025,7 @@ TEST(IrcProtocolWithServer, 354) RECV(":server 354 alice #test user2 host2 server bob * 0 account2"); CHECK_SRV("--", "[#test] bob [account2] (user2@host2) * 0 ()", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user2@host2", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("account2", ptr_nick2->account); @@ -5004,7 +5034,7 @@ TEST(IrcProtocolWithServer, 354) 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)", - "irc_354,irc_numeric,log3"); + "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); @@ -5014,7 +5044,7 @@ TEST(IrcProtocolWithServer, 354) ":real name 3"); CHECK_SRV("--", "[#test] bob [account4] (user4@host4) H@ 0 (real name 3)", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user4@host4", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("account4", ptr_nick2->account); @@ -5024,7 +5054,7 @@ TEST(IrcProtocolWithServer, 354) ":real name 4"); CHECK_SRV("--", "[#test] bob [account5] (user5@host5) G@ 0 (real name 4)", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user5@host5", ptr_nick2->host); LONGS_EQUAL(1, ptr_nick2->away); STRCMP_EQUAL("account5", ptr_nick2->account); @@ -5034,7 +5064,7 @@ TEST(IrcProtocolWithServer, 354) ":real name 5"); CHECK_SRV("--", "[#test] bob [account6] (user6@host6) * 0 (real name 5)", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user6@host6", ptr_nick2->host); LONGS_EQUAL(1, ptr_nick2->away); STRCMP_EQUAL("account6", ptr_nick2->account); @@ -5044,7 +5074,7 @@ TEST(IrcProtocolWithServer, 354) ":real name 6"); CHECK_SRV("--", "[#test] bob [account7] (user7@host7) H@ 0 (real name 6)", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); STRCMP_EQUAL("user7@host7", ptr_nick2->host); LONGS_EQUAL(0, ptr_nick2->away); STRCMP_EQUAL("account7", ptr_nick2->account); @@ -5058,30 +5088,30 @@ TEST(IrcProtocolWithServer, 354) /* channel not found */ RECV(":server 354 alice #xyz"); - CHECK_SRV("--", "[#xyz]", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz]", "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2"); - CHECK_SRV("--", "[#xyz] user2", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz] user2", "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2"); - CHECK_SRV("--", "[#xyz] user2 host2", "irc_354,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz] user2 host2", "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server"); CHECK_SRV("--", "[#xyz] user2 host2 server", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server bob"); CHECK_SRV("--", "[#xyz] user2 host2 server bob", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server bob *"); CHECK_SRV("--", "[#xyz] user2 host2 server bob *", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server bob G@ 0"); CHECK_SRV("--", "[#xyz] user2 host2 server bob G@ 0", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server bob H@ 0 account"); CHECK_SRV("--", "[#xyz] bob [account] (user2@host2) H@ 0 ()", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); RECV(":server 354 alice #xyz user2 host2 server bob G@ 0 account " ":real name"); CHECK_SRV("--", "[#xyz] bob [account] (user2@host2) G@ 0 (real name)", - "irc_354,irc_numeric,log3"); + "irc_354,irc_numeric,nick_server,log3"); hashtable_remove (ptr_server->cap_list, "account-notify"); } @@ -5107,40 +5137,40 @@ 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,log3"); + "irc_366,irc_numeric,nick_server,log3"); 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,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :bob"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 2 nicks (0 ops, 0 voiced, 2 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :@carol"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 3 nicks (1 op, 0 voiced, 2 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :+dan!user@host"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 4 nicks (1 op, 1 voiced, 2 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :@evans"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 5 nicks (2 ops, 1 voiced, 2 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :+fred"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 6 nicks (2 ops, 2 voiced, 2 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :greg"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 7 nicks (2 ops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 005 alice " IRC_MSG_005 " :are supported"); @@ -5148,13 +5178,13 @@ TEST(IrcProtocolWithServer, 366) RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 8 nicks (2 ops, 1 halfop, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :%ian"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("--", "Channel #test: 9 nicks (2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 005 alice PREFIX=(qaohv)~&@%+ :are supported"); @@ -5163,28 +5193,28 @@ TEST(IrcProtocolWithServer, 366) CHECK_CHAN( "--", "Channel #test: 10 nicks (1 owner, 0 admins, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :&karl"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN( "--", "Channel #test: 11 nicks (1 owner, 1 admin, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :&mike"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN( "--", "Channel #test: 12 nicks (1 owner, 2 admins, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :~olivia"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN( "--", "Channel #test: 13 nicks (2 owners, 2 admins, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 005 alice PREFIX=(zqaohv)?~&@%+ :are supported"); @@ -5193,20 +5223,21 @@ TEST(IrcProtocolWithServer, 366) CHECK_CHAN( "--", "Channel #test: 14 nicks (1 +z, 2 owners, 2 admins, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); RECV(":server 353 alice = #test :?robert"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN( "--", "Channel #test: 15 nicks (2 +z, 2 owners, 2 admins, 2 ops, 2 halfops, 2 voiced, 3 regular)", - "irc_366,irc_numeric,log3"); + "irc_366,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 366 alice #xyz end"); - CHECK_SRV("--", "#xyz: end", "irc_366,irc_numeric,log3"); + 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", "irc_366,irc_numeric,log3"); + CHECK_SRV("--", "#xyz: End of /NAMES list", + "irc_366,irc_numeric,nick_server,log3"); } /* @@ -5228,30 +5259,30 @@ TEST(IrcProtocolWithServer, 367) RECV(":server 367 alice #test nick1!user1@host1"); CHECK_CHAN("--", "[#test] [1] nick1!user1@host1 banned", - "irc_367,irc_numeric,log3"); + "irc_367,irc_numeric,nick_server,log3"); 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,log3"); + "irc_367,irc_numeric,nick_server,log3"); RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2 " "1205585109"); CHECK_CHAN("--", "[#test] [3] nick1!user1@host1 banned " "by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", - "irc_367,irc_numeric,log3"); + "irc_367,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 367 alice #xyz nick1!user1@host1"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned", - "irc_367,irc_numeric,log3"); + "irc_367,irc_numeric,nick_server,log3"); RECV(":server 367 alice #xyz nick1!user1@host1 nick2!user2@host2"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned by nick2 (user2@host2)", - "irc_367,irc_numeric,log3"); + "irc_367,irc_numeric,nick_server,log3"); RECV(":server 367 alice #xyz nick1!user1@host1 nick2!user2@host2 " "1205585109"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned by nick2 (user2@host2) " "on Sat, 15 Mar 2008 12:45:09", - "irc_367,irc_numeric,log3"); + "irc_367,irc_numeric,nick_server,log3"); } /* @@ -5270,21 +5301,21 @@ TEST(IrcProtocolWithServer, 368) CHECK_ERROR_PARAMS("368", 1, 2); RECV(":server 368 alice #test"); - CHECK_CHAN("--", "[#test]", "irc_368,irc_numeric,log3"); + CHECK_CHAN("--", "[#test]", "irc_368,irc_numeric,nick_server,log3"); RECV(":server 368 alice #test end"); - CHECK_CHAN("--", "[#test] end", "irc_368,irc_numeric,log3"); + 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", - "irc_368,irc_numeric,log3"); + "irc_368,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 368 alice #xyz"); - CHECK_SRV("--", "[#xyz]", "irc_368,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz]", "irc_368,irc_numeric,nick_server,log3"); RECV(":server 368 alice #xyz end"); - CHECK_SRV("--", "[#xyz] end", "irc_368,irc_numeric,log3"); + CHECK_SRV("--", "[#xyz] end", "irc_368,irc_numeric,nick_server,log3"); RECV(":server 368 alice #xyz :End of Channel Ban List"); CHECK_SRV("--", "[#xyz] End of Channel Ban List", - "irc_368,irc_numeric,log3"); + "irc_368,irc_numeric,nick_server,log3"); } /* @@ -5303,12 +5334,14 @@ TEST(IrcProtocolWithServer, 401) CHECK_ERROR_PARAMS("401", 1, 2); RECV(":server 401 alice bob"); - CHECK_SRV("--", "bob", "irc_401,irc_numeric,log3"); + 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", "irc_401,irc_numeric,log3"); + CHECK_SRV("--", "bob: No such nick/channel", + "irc_401,irc_numeric,nick_server,log3"); RECV(":server 401 alice #unknown :No such nick/channel"); - CHECK_SRV("--", "#unknown: No such nick/channel", "irc_401,irc_numeric,log3"); + CHECK_SRV("--", "#unknown: No such nick/channel", + "irc_401,irc_numeric,nick_server,log3"); } /* @@ -5327,9 +5360,10 @@ TEST(IrcProtocolWithServer, 402) CHECK_ERROR_PARAMS("402", 1, 2); RECV(":server 402 alice server"); - CHECK_SRV("--", "server", "irc_402,irc_numeric,log3"); + CHECK_SRV("--", "server", "irc_402,irc_numeric,nick_server,log3"); RECV(":server 402 alice server :No such server"); - CHECK_SRV("--", "server: No such server", "irc_402,irc_numeric,log3"); + CHECK_SRV("--", "server: No such server", + "irc_402,irc_numeric,nick_server,log3"); } /* @@ -5348,13 +5382,13 @@ TEST(IrcProtocolWithServer, 404) CHECK_ERROR_PARAMS("404", 1, 2); RECV(":server 404 alice #test"); - CHECK_SRV("--", "#test", "irc_404,irc_numeric,log3"); + 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", - "irc_404,irc_numeric,log3"); + "irc_404,irc_numeric,nick_server,log3"); RECV(":server 404 alice #test2 :Cannot send to channel"); CHECK_SRV("--", "#test2: Cannot send to channel", - "irc_404,irc_numeric,log3"); + "irc_404,irc_numeric,nick_server,log3"); } /* @@ -5373,13 +5407,13 @@ TEST(IrcProtocolWithServer, 415) CHECK_ERROR_PARAMS("415", 1, 2); RECV(":server 415 alice #test"); - CHECK_SRV("--", "#test", "irc_415,irc_numeric,log3"); + 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)", - "irc_415,irc_numeric,log3"); + "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)", - "irc_415,irc_numeric,log3"); + "irc_415,irc_numeric,nick_server,log3"); } /* @@ -5431,18 +5465,20 @@ TEST(IrcProtocolWithServer, 432_connected) CHECK_ERROR_PARAMS("432", 1, 2); RECV(":server 432 alice test%+"); - CHECK_SRV("--", "test%+", "irc_432,irc_numeric,log3"); + CHECK_SRV("--", "test%+", "irc_432,irc_numeric,nick_server,log3"); RECV(":server 432 alice test%+ error"); - CHECK_SRV("--", "test%+: error", "irc_432,irc_numeric,log3"); + CHECK_SRV("--", "test%+: error", "irc_432,irc_numeric,nick_server,log3"); RECV(":server 432 alice test%+ :Erroneous Nickname"); - CHECK_SRV("--", "test%+: Erroneous Nickname", "irc_432,irc_numeric,log3"); + 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", "irc_432,irc_numeric,log3"); + CHECK_SRV("--", "#test: Erroneous Nickname", + "irc_432,irc_numeric,nick_server,log3"); } /* @@ -5487,12 +5523,12 @@ TEST(IrcProtocolWithServer, 433_connected) CHECK_ERROR_PARAMS("433", 1, 2); RECV(":server 433 alice test"); - CHECK_SRV("--", "test", "irc_433,irc_numeric,log3"); + CHECK_SRV("--", "test", "irc_433,irc_numeric,nick_server,log3"); RECV(":server 433 alice test error"); - CHECK_SRV("--", "test: error", "irc_433,irc_numeric,log3"); + 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.", - "irc_433,irc_numeric,log3"); + "irc_433,irc_numeric,nick_server,log3"); /* * special case: nickname already used looks like a channel (it should @@ -5501,7 +5537,7 @@ TEST(IrcProtocolWithServer, 433_connected) */ RECV(":server 433 alice #test :Nickname is already in use."); CHECK_SRV("--", "#test: Nickname is already in use.", - "irc_433,irc_numeric,log3"); + "irc_433,irc_numeric,nick_server,log3"); } /* @@ -5512,13 +5548,13 @@ TEST(IrcProtocolWithServer, 433_connected) TEST(IrcProtocolWithServer, 437_not_connected) { RECV(":server 437 * alice error"); - CHECK_SRV("--", "* alice error", "irc_437,irc_numeric,log3"); + 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", - "irc_437,irc_numeric,log3"); + "irc_437,irc_numeric,nick_server,log3"); RECV(":server 437 * alice1 :Nick/channel is temporarily unavailable"); CHECK_SRV("--", "* alice1 Nick/channel is temporarily unavailable", - "irc_437,irc_numeric,log3"); + "irc_437,irc_numeric,nick_server,log3"); } /* @@ -5537,15 +5573,15 @@ TEST(IrcProtocolWithServer, 437_connected) CHECK_ERROR_PARAMS("437", 1, 2); RECV(":server 437 * alice"); - CHECK_SRV("--", "* alice", "irc_437,irc_numeric,log3"); + CHECK_SRV("--", "* alice", "irc_437,irc_numeric,nick_server,log3"); RECV(":server 437 * alice error"); - CHECK_SRV("--", "* alice error", "irc_437,irc_numeric,log3"); + 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", - "irc_437,irc_numeric,log3"); + "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", - "irc_437,irc_numeric,log3"); + "irc_437,irc_numeric,nick_server,log3"); } /* @@ -5564,14 +5600,15 @@ TEST(IrcProtocolWithServer, 438) CHECK_ERROR_PARAMS("438", 1, 2); RECV(":server 438 alice alice2"); - CHECK_SRV("--", "alice alice2", "irc_438,irc_numeric,log3"); + CHECK_SRV("--", "alice alice2", "irc_438,irc_numeric,nick_server,log3"); RECV(":server 438 alice alice2 error"); - CHECK_SRV("--", "error (alice => alice2)", "irc_438,irc_numeric,log3"); + 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."); CHECK_SRV("--", "Nick change too fast. Please wait 30 seconds. (alice => alice2)", - "irc_438,irc_numeric,log3"); + "irc_438,irc_numeric,nick_server,log3"); } /* @@ -5590,14 +5627,15 @@ TEST(IrcProtocolWithServer, 470) CHECK_ERROR_PARAMS("470", 1, 2); RECV(":server 470 alice #test"); - CHECK_SRV("--", "#test", "irc_470,irc_numeric,log3"); + CHECK_SRV("--", "#test", "irc_470,irc_numeric,nick_server,log3"); RECV(":server 470 alice #test #test2"); - CHECK_SRV("--", "#test: #test2", "irc_470,irc_numeric,log3"); + CHECK_SRV("--", "#test: #test2", "irc_470,irc_numeric,nick_server,log3"); RECV(":server 470 alice #test #test2 forwarding"); - CHECK_SRV("--", "#test: #test2 forwarding", "irc_470,irc_numeric,log3"); + 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", - "irc_470,irc_numeric,log3"); + "irc_470,irc_numeric,nick_server,log3"); } /* @@ -5709,10 +5747,10 @@ 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,log3"); + "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.", - "irc_710,irc_numeric,notify_message,log3"); + "irc_710,irc_numeric,notify_message,nick_nick1,host_user1@host1,log3"); /* channel not found */ RECV(":server 710 #xyz #xyz nick1!user1@host1"); @@ -5740,7 +5778,7 @@ TEST(IrcProtocolWithServer, 711) RECV(":server 711 alice #test :Your KNOCK has been delivered."); CHECK_SRV("--", "#test: Your KNOCK has been delivered.", - "irc_711,irc_numeric,log3"); + "irc_711,irc_numeric,nick_server,log3"); } /* @@ -5762,7 +5800,7 @@ TEST(IrcProtocolWithServer, 712) RECV(":server 712 alice #test :Too many KNOCKs (channel)."); CHECK_SRV("--", "#test: Too many KNOCKs (channel).", - "irc_712,irc_numeric,log3"); + "irc_712,irc_numeric,nick_server,log3"); } /* @@ -5783,7 +5821,8 @@ TEST(IrcProtocolWithServer, 713) CHECK_ERROR_PARAMS("713", 2, 3); RECV(":server 713 alice #test :Channel is open."); - CHECK_SRV("--", "#test: Channel is open.", "irc_713,irc_numeric,log3"); + CHECK_SRV("--", "#test: Channel is open.", + "irc_713,irc_numeric,nick_server,log3"); } /* @@ -5805,7 +5844,7 @@ TEST(IrcProtocolWithServer, 714) RECV(":server 714 alice #test :You are already on that channel."); CHECK_SRV("--", "#test: You are already on that channel.", - "irc_714,irc_numeric,log3"); + "irc_714,irc_numeric,nick_server,log3"); } /* @@ -5828,7 +5867,7 @@ TEST(IrcProtocolWithServer, 716) CHECK_SRV("--", "bob: is in +g mode and must manually allow you to message them. " "Your message was discarded.", - "irc_716,irc_numeric,log3"); + "irc_716,irc_numeric,nick_server,log3"); /* open private buffer */ RECV(":bob!user@host PRIVMSG alice :hi Alice!"); @@ -5838,7 +5877,7 @@ TEST(IrcProtocolWithServer, 716) CHECK_PV("bob", "--", "bob: is in +g mode and must manually allow you to message them. " "Your message was discarded.", - "irc_716,irc_numeric,log3"); + "irc_716,irc_numeric,nick_server,log3"); } /* @@ -5858,14 +5897,14 @@ TEST(IrcProtocolWithServer, 717) 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,log3"); + "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."); CHECK_PV("bob", "--", "bob: has been informed that you messaged them.", - "irc_717,irc_numeric,log3"); + "irc_717,irc_numeric,nick_server,log3"); } /* @@ -5889,29 +5928,29 @@ TEST(IrcProtocolWithServer, 728) RECV(":server 728 alice #test q nick1!user1@host1"); CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #test q nick1!user1@host1 alice!user@host"); CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted by alice (user@host)", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #test q nick1!user1@host1 alice!user@host " "1351350090"); CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted by alice (user@host) " "on Sat, 27 Oct 2012 15:01:30", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 728 alice #xyz q nick1!user1@host1"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #xyz q nick1!user1@host1 alice!user@host"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host)", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); RECV(":server 728 alice #xyz q nick1!user1@host1 alice!user@host " "1351350090"); CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host) " "on Sat, 27 Oct 2012 15:01:30", - "irc_728,irc_numeric,log3"); + "irc_728,irc_numeric,nick_server,log3"); } /* @@ -5932,21 +5971,21 @@ TEST(IrcProtocolWithServer, 729) CHECK_ERROR_PARAMS("729", 2, 3); RECV(":server 729 alice #test q"); - CHECK_CHAN("--", "[#test]", "irc_729,irc_numeric,log3"); + 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,log3"); + 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", - "irc_729,irc_numeric,log3"); + "irc_729,irc_numeric,nick_server,log3"); /* channel not found */ RECV(":server 729 alice #xyz q"); - CHECK_SRV("--", "[#xyz]", "irc_729,irc_numeric,log3"); + 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,log3"); + 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", - "irc_729,irc_numeric,log3"); + "irc_729,irc_numeric,nick_server,log3"); } /* @@ -6010,10 +6049,10 @@ TEST(IrcProtocolWithServer, 732) CHECK_ERROR_PARAMS("732", 0, 1); RECV(":server 732 alice"); - CHECK_SRV("--", "", "irc_732,irc_numeric,log3"); + CHECK_SRV("--", "", "irc_732,irc_numeric,nick_server,log3"); RECV(":server 732 alice :nick1!user1@host1,nick2!user2@host2"); CHECK_SRV("--", "nick1!user1@host1,nick2!user2@host2", - "irc_732,irc_numeric,log3"); + "irc_732,irc_numeric,nick_server,log3"); } /* @@ -6030,11 +6069,11 @@ TEST(IrcProtocolWithServer, 733) CHECK_ERROR_PARAMS("733", 0, 1); RECV(":server 733 alice"); - CHECK_SRV("--", "", "irc_733,irc_numeric,log3"); + CHECK_SRV("--", "", "irc_733,irc_numeric,nick_server,log3"); RECV(":server 733 alice end"); - CHECK_SRV("--", "end", "irc_733,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "End of MONITOR list", "irc_733,irc_numeric,nick_server,log3"); } /* @@ -6055,11 +6094,12 @@ TEST(IrcProtocolWithServer, 734) CHECK_ERROR_PARAMS("734", 2, 3); RECV(":server 734 alice 10 nick1,nick2"); - CHECK_SRV("=!=", " (10)", "irc_734,irc_numeric,log3"); + 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,log3"); + 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)", "irc_734,irc_numeric,log3"); + CHECK_SRV("=!=", "Monitor list is full (10)", + "irc_734,irc_numeric,nick_server,log3"); } /* @@ -6078,19 +6118,19 @@ TEST(IrcProtocolWithServer, 742) CHECK_ERROR_PARAMS("742", 1, 2); RECV(":server 742 alice #test"); - CHECK_SRV("--", "#test", "irc_742,irc_numeric,log3"); + 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"); CHECK_CHAN("--", "#test: n nstlk MODE cannot be set due to channel having " "an active MLOCK restriction policy", - "irc_742,irc_numeric,log3"); + "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"); CHECK_SRV("--", "#test2: n nstlk MODE cannot be set due to channel having " "an active MLOCK restriction policy", - "irc_742,irc_numeric,log3"); + "irc_742,irc_numeric,nick_server,log3"); } /* @@ -6113,14 +6153,15 @@ TEST(IrcProtocolWithServer, 900) CHECK_ERROR_PARAMS("900", 3, 4); RECV(":server 900 alice alice!user@host alice logged"); - CHECK_SRV("--", "logged (alice!user@host)", "irc_900,irc_numeric,log3"); + 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)", - "irc_900,irc_numeric,log3"); + "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", - "irc_900,irc_numeric,log3"); + "irc_900,irc_numeric,nick_server,log3"); } /* @@ -6141,9 +6182,10 @@ TEST(IrcProtocolWithServer, 901) CHECK_ERROR_PARAMS("901", 2, 3); RECV(":server 901 alice nick!user@host logged"); - CHECK_SRV("--", "logged", "irc_901,irc_numeric,log3"); + 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", "irc_901,irc_numeric,log3"); + CHECK_SRV("--", "You are now logged out", + "irc_901,irc_numeric,nick_server,log3"); } /* @@ -6165,20 +6207,20 @@ TEST(IrcProtocolWithServer, 903_907) CHECK_ERROR_PARAMS("907", 0, 1); RECV(":server 903 alice ok"); - CHECK_SRV("--", "ok", "irc_903,irc_numeric,log3"); + CHECK_SRV("--", "ok", "irc_903,irc_numeric,nick_server,log3"); RECV(":server 903 alice :SASL authentication successful"); CHECK_SRV("--", "SASL authentication successful", - "irc_903,irc_numeric,log3"); + "irc_903,irc_numeric,nick_server,log3"); RECV(":server 903 * :SASL authentication successful"); CHECK_SRV("--", "SASL authentication successful", - "irc_903,irc_numeric,log3"); + "irc_903,irc_numeric,nick_server,log3"); RECV(":server 907 alice ok"); - CHECK_SRV("--", "ok", "irc_907,irc_numeric,log3"); + CHECK_SRV("--", "ok", "irc_907,irc_numeric,nick_server,log3"); RECV(":server 907 alice :SASL authentication successful"); CHECK_SRV("--", "SASL authentication successful", - "irc_907,irc_numeric,log3"); + "irc_907,irc_numeric,nick_server,log3"); } /* @@ -6210,24 +6252,28 @@ TEST(IrcProtocolWithServer, 902_904_905_906) CHECK_ERROR_PARAMS("906", 0, 1); RECV(":server 902 alice error"); - CHECK_SRV("--", "error", "irc_902,irc_numeric,log3"); + CHECK_SRV("--", "error", "irc_902,irc_numeric,nick_server,log3"); RECV(":server 902 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", "irc_902,irc_numeric,log3"); + CHECK_SRV("--", "SASL authentication failed", + "irc_902,irc_numeric,nick_server,log3"); RECV(":server 904 alice error"); - CHECK_SRV("--", "error", "irc_904,irc_numeric,log3"); + CHECK_SRV("--", "error", "irc_904,irc_numeric,nick_server,log3"); RECV(":server 904 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", "irc_904,irc_numeric,log3"); + CHECK_SRV("--", "SASL authentication failed", + "irc_904,irc_numeric,nick_server,log3"); RECV(":server 905 alice error"); - CHECK_SRV("--", "error", "irc_905,irc_numeric,log3"); + CHECK_SRV("--", "error", "irc_905,irc_numeric,nick_server,log3"); RECV(":server 905 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", "irc_905,irc_numeric,log3"); + CHECK_SRV("--", "SASL authentication failed", + "irc_905,irc_numeric,nick_server,log3"); RECV(":server 906 alice error"); - CHECK_SRV("--", "error", "irc_906,irc_numeric,log3"); + CHECK_SRV("--", "error", "irc_906,irc_numeric,nick_server,log3"); RECV(":server 906 alice :SASL authentication failed"); - CHECK_SRV("--", "SASL authentication failed", "irc_906,irc_numeric,log3"); + CHECK_SRV("--", "SASL authentication failed", + "irc_906,irc_numeric,nick_server,log3"); } /* @@ -6251,54 +6297,54 @@ TEST(IrcProtocolWithServer, server_mode_reason) RECV(":server 973 alice"); CHECK_NO_MSG; RECV(":server 973 alice mode"); - CHECK_SRV("--", "mode", "irc_973,irc_numeric,log3"); + CHECK_SRV("--", "mode", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 973 alice mode test"); - CHECK_SRV("--", "mode: test", "irc_973,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "mode: test", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 974 alice"); CHECK_NO_MSG; RECV(":server 974 alice mode"); - CHECK_SRV("--", "mode", "irc_974,irc_numeric,log3"); + CHECK_SRV("--", "mode", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 974 alice mode test"); - CHECK_SRV("--", "mode: test", "irc_974,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "mode: test", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 975 alice"); CHECK_NO_MSG; RECV(":server 975 alice mode"); - CHECK_SRV("--", "mode", "irc_975,irc_numeric,log3"); + CHECK_SRV("--", "mode", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 975 alice mode test"); - CHECK_SRV("--", "mode: test", "irc_975,irc_numeric,log3"); + 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,log3"); + CHECK_SRV("--", "mode: test", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 973 bob"); - CHECK_SRV("--", "bob", "irc_973,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 973 bob mode"); - CHECK_SRV("--", "bob: mode", "irc_973,irc_numeric,log3"); + 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,log3"); + 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,log3"); + CHECK_SRV("--", "bob: mode test", "irc_973,irc_numeric,nick_server,log3"); RECV(":server 974 bob"); - CHECK_SRV("--", "bob", "irc_974,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 974 bob mode"); - CHECK_SRV("--", "bob: mode", "irc_974,irc_numeric,log3"); + 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,log3"); + 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,log3"); + CHECK_SRV("--", "bob: mode test", "irc_974,irc_numeric,nick_server,log3"); RECV(":server 975 bob"); - CHECK_SRV("--", "bob", "irc_975,irc_numeric,log3"); + CHECK_SRV("--", "bob", "irc_975,irc_numeric,nick_server,log3"); RECV(":server 975 bob mode"); - CHECK_SRV("--", "bob: mode", "irc_975,irc_numeric,log3"); + 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,log3"); + 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,log3"); + CHECK_SRV("--", "bob: mode test", "irc_975,irc_numeric,nick_server,log3"); }