diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-03-12 19:26:26 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-03-12 19:26:26 +0100 |
commit | 1c1ef05451cf3e2abd960faa45b53e0cc2d32c5c (patch) | |
tree | b66c016491c3b50593d1ddf69fecf8f745daa7f0 | |
parent | 73476cc0f861f8dc160afc4021c38032d2a2c567 (diff) | |
download | weechat-1c1ef05451cf3e2abd960faa45b53e0cc2d32c5c.zip |
irc: use computed nick color in many messages instead of option weechat.color.chat_nick
-rw-r--r-- | src/plugins/irc/irc-channel.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 20 | ||||
-rw-r--r-- | src/plugins/irc/irc-ctcp.c | 21 | ||||
-rw-r--r-- | src/plugins/irc/irc-display.c | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-nick.c | 40 | ||||
-rw-r--r-- | src/plugins/irc/irc-nick.h | 6 | ||||
-rw-r--r-- | src/plugins/irc/irc-notify.c | 29 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 153 |
8 files changed, 183 insertions, 92 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 4b8dc06fd..a45248885 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -778,7 +778,9 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server, weechat_printf (ptr_channel->buffer, _("%s%s%s %s(%s%s%s)%s is back on server"), weechat_prefix ("join"), - irc_nick_color_for_server_message (nick, nickname), + irc_nick_color_for_server_message (server, + nick, + nickname), (nick) ? nick->name : nickname, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index c5d1112bc..46c8baa90 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -948,7 +948,8 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, NULL), _("%sCTCP query to %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (ptr_server, + NULL, argv[1]), argv[1], IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -971,7 +972,8 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, NULL), _("%sCTCP query to %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (ptr_server, NULL, + argv[1]), argv[1], IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -2593,7 +2595,9 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, "%sMSG%s(%s%s%s)%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (ptr_server, + NULL, + targets[i]), targets[i], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2625,7 +2629,9 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, "%sMSG%s(%s%s%s)%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (ptr_server, + NULL, + targets[i]), targets[i], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2821,7 +2827,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ _("Notice"), IRC_COLOR_RESET, - (is_channel) ? IRC_COLOR_CHAT_CHANNEL : IRC_COLOR_CHAT_NICK, + (is_channel) ? IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_message (ptr_server, NULL, argv[arg_target]), argv[arg_target], IRC_COLOR_RESET, (string) ? string : str_args); @@ -2928,7 +2934,9 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, weechat_printf (ptr_server->buffer, _("%s: notification added for %s%s"), IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (ptr_server, + NULL, + ptr_notify->nick), ptr_notify->nick); irc_notify_check_now (ptr_notify); } diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index 1fc11a1e1..6094d7bc4 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -127,7 +127,7 @@ irc_ctcp_display_request (struct t_irc_server *server, irc_protocol_tags (command, "irc_ctcp", NULL), _("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -192,7 +192,9 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, _("%sCTCP reply from %s%s%s: %s%s%s " "%ld.%ld %s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, + NULL, + nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -218,7 +220,8 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, NULL), _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, + nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -237,7 +240,8 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, irc_protocol_tags (command, NULL, NULL), _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, + nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -300,7 +304,8 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server, NULL), _("%sCTCP reply to %s%s%s: %s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, + nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -837,7 +842,7 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, "received from %s%s%s: \"%s\""), weechat_prefix ("error"), IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, nick), nick, IRC_COLOR_RESET, pos_file); @@ -1037,7 +1042,9 @@ irc_ctcp_recv (struct t_irc_server *server, const char *command, _("%sUnknown CTCP requested by %s%s%s: " "%s%s%s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, + NULL, + nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c index 8bd2b343b..fede0722c 100644 --- a/src/plugins/irc/irc-display.c +++ b/src/plugins/irc/irc-display.c @@ -142,7 +142,7 @@ irc_display_away (struct t_irc_server *server, const char *string1, "away_info", "%s[%s%s%s %s: %s%s]", IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + IRC_COLOR_CHAT_NICK_SELF, server->nick, IRC_COLOR_RESET, string1, diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 98f3b80d1..249f98040 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -937,25 +937,47 @@ irc_nick_as_prefix (struct t_irc_server *server, struct t_irc_nick *nick, } /* - * irc_nick_color_for_server_message: return WeeChat color code for a nick - * (used in a server message) + * irc_nick_color_for_message: return WeeChat color code for a nick */ const char * -irc_nick_color_for_server_message (struct t_irc_nick *nick, - const char *nickname) +irc_nick_color_for_message (struct t_irc_server *server, + struct t_irc_nick *nick, + const char *nickname) { - if (weechat_config_boolean(irc_config_look_color_nicks_in_server_messages)) + if (nick) + return nick->color; + + if (nickname) { - if (nick) - return nick->color; - if (nickname) - return irc_nick_find_color (nickname); + if (server + && (irc_server_strcasecmp (server, nickname, server->nick) == 0)) + { + return IRC_COLOR_CHAT_NICK_SELF; + } + return irc_nick_find_color (nickname); } + return IRC_COLOR_CHAT_NICK; } /* + * irc_nick_color_for_server_message: return WeeChat color code for a nick + * (used in a server message) + */ + +const char * +irc_nick_color_for_server_message (struct t_irc_server *server, + struct t_irc_nick *nick, + const char *nickname) +{ + if (!weechat_config_boolean(irc_config_look_color_nicks_in_server_messages)) + return IRC_COLOR_CHAT_NICK; + + return irc_nick_color_for_message (server, nick, nickname); +} + +/* * irc_nick_color_for_pv: return string with color of nick for private */ diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h index 132f5182d..6efc948aa 100644 --- a/src/plugins/irc/irc-nick.h +++ b/src/plugins/irc/irc-nick.h @@ -89,7 +89,11 @@ extern char *irc_nick_as_prefix (struct t_irc_server *server, struct t_irc_nick *nick, const char *nickname, const char *force_color); -extern const char *irc_nick_color_for_server_message (struct t_irc_nick *nick, +extern const char *irc_nick_color_for_message (struct t_irc_server *server, + struct t_irc_nick *nick, + const char *nickname); +extern const char *irc_nick_color_for_server_message (struct t_irc_server *server, + struct t_irc_nick *nick, const char *nickname); extern const char * irc_nick_color_for_pv (struct t_irc_channel *channel, const char *nickname); diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c index ca9466d9e..30c7f77d1 100644 --- a/src/plugins/irc/irc-notify.c +++ b/src/plugins/irc/irc-notify.c @@ -360,14 +360,16 @@ irc_notify_free_all (struct t_irc_server *server) */ void -irc_notify_display (struct t_gui_buffer *buffer, struct t_irc_notify *notify) +irc_notify_display (struct t_irc_server *server, struct t_gui_buffer *buffer, + struct t_irc_notify *notify) { if ((notify->is_on_server < 0) || (!notify->is_on_server && !notify->away_message)) { weechat_printf (buffer, " %s%s%s @ %s%s%s: %s%s", - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (server, NULL, + notify->nick), notify->nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_SERVER, @@ -383,7 +385,8 @@ irc_notify_display (struct t_gui_buffer *buffer, struct t_irc_notify *notify) { weechat_printf (buffer, " %s%s%s @ %s%s%s: %s%s %s%s%s%s%s%s", - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (server, NULL, + notify->nick), notify->nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_SERVER, @@ -425,7 +428,7 @@ irc_notify_display_list (struct t_irc_server *server) for (ptr_notify = server->notify_list; ptr_notify; ptr_notify = ptr_notify->next_notify) { - irc_notify_display (server->buffer, ptr_notify); + irc_notify_display (server, server->buffer, ptr_notify); } } else @@ -448,7 +451,7 @@ irc_notify_display_list (struct t_irc_server *server) weechat_printf (NULL, ""); weechat_printf (NULL, _("Notify list for all servers:")); } - irc_notify_display (NULL, ptr_notify); + irc_notify_display (ptr_server, NULL, ptr_notify); count++; } } @@ -543,7 +546,9 @@ irc_notify_set_is_on_server (struct t_irc_notify *notify, _("%snotify: %s%s%s has joined") : _("%snotify: %s%s%s has quit")), weechat_prefix ("network"), - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (notify->server, + NULL, + notify->nick), notify->nick, (is_on_server) ? IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT); @@ -578,7 +583,9 @@ irc_notify_set_away_message (struct t_irc_notify *notify, notify->nick), _("%snotify: %s%s%s is now away: \"%s\""), weechat_prefix ("network"), - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (notify->server, + NULL, + notify->nick), notify->nick, IRC_COLOR_RESET, away_message); @@ -592,7 +599,9 @@ irc_notify_set_away_message (struct t_irc_notify *notify, notify->nick), _("%snotify: %s%s%s is back"), weechat_prefix ("network"), - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (notify->server, + NULL, + notify->nick), notify->nick, IRC_COLOR_RESET); irc_notify_send_signal (notify, "back", NULL); @@ -605,7 +614,9 @@ irc_notify_set_away_message (struct t_irc_notify *notify, notify->nick), _("%snotify: %s%s%s is still away: \"%s\""), weechat_prefix ("network"), - irc_nick_color_for_server_message (NULL, notify->nick), + irc_nick_color_for_server_message (notify->server, + NULL, + notify->nick), notify->nick, IRC_COLOR_RESET, away_message); diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index bb63b5882..f24e6c558 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -500,7 +500,7 @@ IRC_PROTOCOL_CALLBACK(invite) IRC_COLOR_CHAT_CHANNEL, (argv[3][0] == ':') ? argv[3] + 1 : argv[3], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, nick), nick, IRC_COLOR_RESET); } @@ -586,7 +586,7 @@ IRC_PROTOCOL_CALLBACK(join) nick), _("%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"), weechat_prefix ("join"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_CHAT_DELIMITERS, (display_host) ? " (" : "", @@ -643,10 +643,10 @@ IRC_PROTOCOL_CALLBACK(kick) irc_protocol_tags (command, NULL, NULL), _("%s%s%s%s has kicked %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (ptr_nick_kicked, argv[3]), + irc_nick_color_for_server_message (server, ptr_nick_kicked, argv[3]), argv[3], IRC_COLOR_MESSAGE_QUIT, IRC_COLOR_CHAT_DELIMITERS, @@ -662,10 +662,10 @@ IRC_PROTOCOL_CALLBACK(kick) irc_protocol_tags (command, NULL, NULL), _("%s%s%s%s has kicked %s%s%s"), weechat_prefix ("quit"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (ptr_nick_kicked, argv[3]), + irc_nick_color_for_server_message (server, ptr_nick_kicked, argv[3]), argv[3], IRC_COLOR_MESSAGE_QUIT); } @@ -744,7 +744,7 @@ IRC_PROTOCOL_CALLBACK(kill) _("%s%sYou were killed by %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_MESSAGE_QUIT, IRC_COLOR_CHAT_DELIMITERS, @@ -761,7 +761,7 @@ IRC_PROTOCOL_CALLBACK(kill) _("%s%sYou were killed by %s%s%s"), weechat_prefix ("quit"), IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_MESSAGE_QUIT); } @@ -862,7 +862,7 @@ IRC_PROTOCOL_CALLBACK(mode) pos_modes, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick); } else @@ -878,7 +878,7 @@ IRC_PROTOCOL_CALLBACK(mode) pos_modes, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, nick), nick); irc_mode_user_set (server, pos_modes, 0); } @@ -990,7 +990,7 @@ IRC_PROTOCOL_CALLBACK(nick) old_color : IRC_COLOR_CHAT_NICK, nick, IRC_COLOR_RESET, - irc_nick_color_for_server_message (ptr_nick, new_nick), + irc_nick_color_for_message (server, ptr_nick, new_nick), new_nick, IRC_COLOR_RESET); } @@ -1094,7 +1094,7 @@ IRC_PROTOCOL_CALLBACK(notice) _("Notice"), (notice_op) ? "Op" : ((notice_voice) ? "Voice" : ""), IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_message (server, ptr_nick, nick), (nick && nick[0]) ? nick : "?", IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -1144,7 +1144,8 @@ IRC_PROTOCOL_CALLBACK(notice) nick), "%s%s%s%s: %s", weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, + nick), nick, IRC_COLOR_RESET, pos_args); @@ -1175,7 +1176,9 @@ IRC_PROTOCOL_CALLBACK(notice) /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ _("Notice"), IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, + NULL, + pos_target), pos_target, IRC_COLOR_RESET, pos_args); @@ -1190,7 +1193,9 @@ IRC_PROTOCOL_CALLBACK(notice) nick), "%s%s%s %s(%s%s%s)%s: %s", weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, + NULL, + nick), nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -1209,7 +1214,9 @@ IRC_PROTOCOL_CALLBACK(notice) nick), "%s%s%s%s: %s", weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, + NULL, + nick), nick, IRC_COLOR_RESET, pos_args); @@ -1295,7 +1302,7 @@ IRC_PROTOCOL_CALLBACK(part) _("%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_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_CHAT_DELIMITERS, (display_host) ? " (" : "", @@ -1328,7 +1335,7 @@ IRC_PROTOCOL_CALLBACK(part) _("%s%s%s%s%s%s%s%s%s%s has left " "%s%s%s"), weechat_prefix ("quit"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_CHAT_DELIMITERS, (display_host) ? " (" : "", @@ -1635,7 +1642,7 @@ IRC_PROTOCOL_CALLBACK(quit) "%s(%s%s%s)"), weechat_prefix ("quit"), (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? - irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_CHAT_DELIMITERS, (display_host) ? " (" : "", @@ -1665,7 +1672,7 @@ IRC_PROTOCOL_CALLBACK(quit) _("%s%s%s%s%s%s%s%s%s%s has quit"), weechat_prefix ("quit"), (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? - irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_CHAT_DELIMITERS, (display_host) ? " (" : "", @@ -1799,7 +1806,7 @@ IRC_PROTOCOL_CALLBACK(topic) _("%s%s%s%s has changed topic for %s%s%s " "from \"%s%s%s\" to \"%s%s%s\""), weechat_prefix ("network"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -1823,7 +1830,7 @@ IRC_PROTOCOL_CALLBACK(topic) _("%s%s%s%s has changed topic for %s%s%s " "to \"%s%s%s\""), weechat_prefix ("network"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -1850,7 +1857,7 @@ IRC_PROTOCOL_CALLBACK(topic) _("%s%s%s%s has unset topic for %s%s%s " "(old topic: \"%s%s%s\")"), weechat_prefix ("network"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -1870,7 +1877,7 @@ IRC_PROTOCOL_CALLBACK(topic) irc_protocol_tags (command, NULL, NULL), _("%s%s%s%s has unset topic for %s%s%s"), weechat_prefix ("network"), - irc_nick_color_for_server_message (ptr_nick, nick), + irc_nick_color_for_server_message (server, ptr_nick, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -1907,7 +1914,7 @@ IRC_PROTOCOL_CALLBACK(wallops) irc_protocol_tags (command, NULL, nick), _("%sWallops from %s%s %s(%s%s%s)%s: %s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_message (server, NULL, nick), nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -2134,7 +2141,8 @@ IRC_PROTOCOL_CALLBACK(221) irc_protocol_tags (command, "irc_numeric", NULL), _("%sUser mode for %s%s%s is %s[%s%s%s]"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[2]), argv[2], IRC_COLOR_RESET, IRC_COLOR_CHAT_DELIMITERS, @@ -2187,7 +2195,9 @@ IRC_PROTOCOL_CALLBACK(301) _("%s%s[%s%s%s]%s is away: %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, + NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2312,7 +2322,8 @@ IRC_PROTOCOL_CALLBACK(whois_nick_msg) "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2341,7 +2352,8 @@ IRC_PROTOCOL_CALLBACK(whowas_nick_msg) "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2370,7 +2382,8 @@ IRC_PROTOCOL_CALLBACK(311) "%s%s[%s%s%s] (%s%s@%s%s)%s: %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -2403,7 +2416,8 @@ IRC_PROTOCOL_CALLBACK(312) "%s%s[%s%s%s] %s%s %s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2436,7 +2450,8 @@ IRC_PROTOCOL_CALLBACK(314) _("%s%s[%s%s%s] (%s%s@%s%s)%s was %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -2525,7 +2540,8 @@ IRC_PROTOCOL_CALLBACK(317) "%s%s, signon at: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2557,7 +2573,8 @@ IRC_PROTOCOL_CALLBACK(317) "signon at: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -2752,7 +2769,8 @@ IRC_PROTOCOL_CALLBACK(327) "%s%s[%s%s%s] %s%s %s %s(%s%s%s)", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -2770,7 +2788,8 @@ IRC_PROTOCOL_CALLBACK(327) "%s%s[%s%s%s] %s%s %s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -2895,12 +2914,14 @@ IRC_PROTOCOL_CALLBACK(330_343) "%s%s[%s%s%s] %s%s %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[4]), argv[4]); } else @@ -2915,7 +2936,8 @@ IRC_PROTOCOL_CALLBACK(330_343) "%s%s[%s%s%s] %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -3064,7 +3086,7 @@ IRC_PROTOCOL_CALLBACK(333) /* TRANSLATORS: "%s" after "on" is a date */ _("%sTopic set by %s%s%s%s%s%s%s%s%s on %s"), weechat_prefix ("network"), - irc_nick_color_for_server_message (ptr_nick, topic_nick), + irc_nick_color_for_server_message (server, ptr_nick, topic_nick), topic_nick, IRC_COLOR_CHAT_DELIMITERS, (topic_address && topic_address[0]) ? " (" : "", @@ -3101,7 +3123,7 @@ IRC_PROTOCOL_CALLBACK(333) IRC_COLOR_CHAT_CHANNEL, argv[3], IRC_COLOR_RESET, - irc_nick_color_for_server_message (ptr_nick, topic_nick), + irc_nick_color_for_server_message (server, ptr_nick, topic_nick), topic_nick, IRC_COLOR_CHAT_DELIMITERS, (topic_address && topic_address[0]) ? " (" : "", @@ -3151,7 +3173,8 @@ IRC_PROTOCOL_CALLBACK(338) "%s%s[%s%s%s]%s %s %s%s", weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, @@ -3180,10 +3203,12 @@ IRC_PROTOCOL_CALLBACK(341) irc_protocol_tags (command, "irc_numeric", NULL), _("%s%s%s%s has invited %s%s%s to %s%s%s"), weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[2]), argv[2], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[3]), argv[3], IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -3257,17 +3282,20 @@ IRC_PROTOCOL_CALLBACK(346) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *invite_nick, *invite_address; /* * 346 message looks like: * :server 346 mynick #channel invitemask nick!user@host 1205590879 */ - IRC_PROTOCOL_MIN_ARGS(5); + IRC_PROTOCOL_MIN_ARGS(6); ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; + invite_nick = irc_message_get_nick_from_host (argv[5]); + invite_address = irc_message_get_address_from_host (argv[5]); if (argc >= 7) { datetime = (time_t)(atol (argv[6])); @@ -3286,11 +3314,12 @@ IRC_PROTOCOL_CALLBACK(346) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, - irc_message_get_nick_from_host (argv[5]), + irc_nick_color_for_server_message (server, NULL, + invite_nick), + invite_nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[5]), + invite_address, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, weechat_util_get_time_string (&datetime)); @@ -3311,11 +3340,12 @@ IRC_PROTOCOL_CALLBACK(346) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, - irc_message_get_nick_from_host (argv[5]), + irc_nick_color_for_server_message (server, NULL, + invite_nick), + invite_nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[5]), + invite_address, IRC_COLOR_CHAT_DELIMITERS); } @@ -3371,6 +3401,7 @@ IRC_PROTOCOL_CALLBACK(348) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *exception_nick, *exception_address; /* * 348 message looks like: @@ -3385,6 +3416,8 @@ IRC_PROTOCOL_CALLBACK(348) ptr_channel->buffer : server->buffer; if (argc >= 7) { + exception_nick = irc_message_get_nick_from_host (argv[5]); + exception_address = irc_message_get_address_from_host (argv[5]); datetime = (time_t)(atol (argv[6])); weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, NULL, command, "exceptionlist", @@ -3402,11 +3435,12 @@ IRC_PROTOCOL_CALLBACK(348) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, - irc_message_get_nick_from_host (argv[5]), + irc_nick_color_for_server_message (server, NULL, + exception_nick), + exception_nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[5]), + exception_address, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, weechat_util_get_time_string (&datetime)); @@ -3576,14 +3610,15 @@ IRC_PROTOCOL_CALLBACK(352) command, "who", NULL), irc_protocol_tags (command, "irc_numeric", NULL), - "%s%s[%s%s%s] %s%s%s(%s%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, IRC_COLOR_CHAT_CHANNEL, argv[3], IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + argv[7]), argv[7], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -3910,7 +3945,8 @@ IRC_PROTOCOL_CALLBACK(367) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + irc_message_get_nick_from_host (argv[5])), irc_message_get_nick_from_host (argv[5]), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -3935,7 +3971,8 @@ IRC_PROTOCOL_CALLBACK(367) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - IRC_COLOR_CHAT_NICK, + irc_nick_color_for_server_message (server, NULL, + irc_message_get_nick_from_host (argv[5])), irc_message_get_nick_from_host (argv[5]), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, |