From 417811ba018f02ec0110f1b9899e17dcd2b394f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 13 Apr 2014 11:22:22 +0200 Subject: irc: add alias "whois" for target buffer of messages 401/402 (closes #54) --- src/plugins/irc/irc-protocol.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 274c7805d..f4243c39a 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -508,21 +508,26 @@ IRC_PROTOCOL_CALLBACK(generic_error) ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, NULL, NULL, NULL), - "%s%s%s%s%s%s", - weechat_prefix ("network"), - (ptr_channel && chan_nick - && (irc_server_strcasecmp (server, chan_nick, - ptr_channel->name) == 0)) ? - IRC_COLOR_CHAT_CHANNEL : "", - (chan_nick) ? chan_nick : "", - IRC_COLOR_RESET, - (chan_nick) ? ": " : "", - args); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, + NULL, + command, + ((strcmp (command, "401") == 0) || (strcmp (command, "402") == 0)) ? + "whois" : NULL, + ptr_buffer), + date, + irc_protocol_tags (command, NULL, NULL, NULL), + "%s%s%s%s%s%s", + weechat_prefix ("network"), + (ptr_channel && chan_nick + && (irc_server_strcasecmp (server, chan_nick, + ptr_channel->name) == 0)) ? + IRC_COLOR_CHAT_CHANNEL : "", + (chan_nick) ? chan_nick : "", + IRC_COLOR_RESET, + (chan_nick) ? ": " : "", + args); return WEECHAT_RC_OK; } -- cgit v1.2.3