diff options
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 88 |
1 files changed, 22 insertions, 66 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 707a4fb20..bb33a0c15 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3700,7 +3700,7 @@ 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; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); @@ -3709,8 +3709,7 @@ IRC_PROTOCOL_CALLBACK(346) ptr_channel->buffer : server->buffer; if (argc >= 6) { - invite_nick = irc_message_get_nick_from_host (argv[5]); - invite_address = irc_message_get_address_from_host (argv[5]); + nick_address = irc_protocol_nick_address (server, NULL, irc_message_get_nick_from_host (argv[5]), irc_message_get_address_from_host (argv[5])); if (argc >= 7) { datetime = (time_t)(atol (argv[6])); @@ -3722,7 +3721,7 @@ IRC_PROTOCOL_CALLBACK(346) NULL, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s invited by " - "%s%s %s(%s%s%s)%s on %s"), + "%s on %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -3731,14 +3730,7 @@ IRC_PROTOCOL_CALLBACK(346) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - invite_nick), - invite_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - invite_address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", weechat_util_get_time_string (&datetime)); } else @@ -3750,7 +3742,7 @@ IRC_PROTOCOL_CALLBACK(346) irc_protocol_tags (command, "irc_numeric", NULL, NULL), _("%s%s[%s%s%s] %s%s%s invited by " - "%s%s %s(%s%s%s)"), + "%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -3759,13 +3751,7 @@ IRC_PROTOCOL_CALLBACK(346) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - invite_nick), - invite_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - invite_address, - IRC_COLOR_CHAT_DELIMITERS); + (nick_address[0]) ? nick_address : "?"); } } else @@ -3843,7 +3829,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; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); @@ -3852,9 +3838,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])); + nick_address = irc_protocol_nick_address (server, NULL, irc_message_get_nick_from_host (argv[5]), irc_message_get_address_from_host (argv[5])); weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, command, "exceptionlist", ptr_buffer), @@ -3863,7 +3848,7 @@ IRC_PROTOCOL_CALLBACK(348) NULL, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s]%s exception %s%s%s " - "by %s%s %s(%s%s%s)%s on %s"), + "by %s on %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -3873,14 +3858,7 @@ IRC_PROTOCOL_CALLBACK(348) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - exception_nick), - exception_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - exception_address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", weechat_util_get_time_string (&datetime)); } else @@ -4463,12 +4441,14 @@ IRC_PROTOCOL_CALLBACK(367) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; + nick_address = irc_protocol_nick_address (server, NULL, irc_message_get_nick_from_host (argv[5]), irc_message_get_address_from_host (argv[5])); if (argc >= 7) { datetime = (time_t)(atol (argv[6])); @@ -4480,7 +4460,7 @@ IRC_PROTOCOL_CALLBACK(367) NULL, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s banned by " - "%s%s %s(%s%s%s)%s on %s"), + "%s on %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -4489,14 +4469,7 @@ IRC_PROTOCOL_CALLBACK(367) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - 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, - irc_message_get_address_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", weechat_util_get_time_string (&datetime)); } else @@ -4508,7 +4481,7 @@ IRC_PROTOCOL_CALLBACK(367) irc_protocol_tags (command, "irc_numeric", NULL, NULL), _("%s%s[%s%s%s] %s%s%s banned by " - "%s%s %s(%s%s%s)"), + "%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -4517,13 +4490,7 @@ IRC_PROTOCOL_CALLBACK(367) IRC_COLOR_CHAT_HOST, argv[4], IRC_COLOR_RESET, - 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, - irc_message_get_address_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS); + (nick_address[0]) ? nick_address : "?"); } return WEECHAT_RC_OK; @@ -4775,12 +4742,14 @@ IRC_PROTOCOL_CALLBACK(728) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *nick_address; 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; + nick_address = irc_protocol_nick_address (server, NULL, irc_message_get_nick_from_host (argv[6]), irc_message_get_address_from_host (argv[6])); if (argc >= 8) { datetime = (time_t)(atol (argv[7])); @@ -4792,7 +4761,7 @@ IRC_PROTOCOL_CALLBACK(728) NULL, NULL), /* TRANSLATORS: "%s" after "on" is a date */ _("%s%s[%s%s%s] %s%s%s quieted by " - "%s%s %s(%s%s%s)%s on %s"), + "%s on %s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -4801,14 +4770,7 @@ IRC_PROTOCOL_CALLBACK(728) IRC_COLOR_CHAT_HOST, argv[5], IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[6])), - irc_message_get_nick_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", weechat_util_get_time_string (&datetime)); } else @@ -4820,7 +4782,7 @@ IRC_PROTOCOL_CALLBACK(728) irc_protocol_tags (command, "irc_numeric", NULL, NULL), _("%s%s[%s%s%s] %s%s%s quieted by " - "%s%s %s(%s%s%s)"), + "%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, @@ -4829,13 +4791,7 @@ IRC_PROTOCOL_CALLBACK(728) IRC_COLOR_CHAT_HOST, argv[5], IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[6])), - irc_message_get_nick_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS); + (nick_address[0]) ? nick_address : "?"); } return WEECHAT_RC_OK; |