diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-04 14:07:08 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-04 14:07:08 +0200 |
commit | 86008b8502923d3464b5853f5a63e5b34d20b426 (patch) | |
tree | 8221418c18a8f8d2c26c02bbe7a8f06b5015f3a2 /src/plugins | |
parent | 22b53c6019cae450ac4c8102bcccf952f080597a (diff) | |
download | weechat-86008b8502923d3464b5853f5a63e5b34d20b426.zip |
irc: display target of notice when it is displayed in channel
With the new option irc.look.notice_welcome_redirect, a private notice could
have a channel at beginning of message (with format "[#channel]") and then be
displayed on the channel, without difference with a real channel notice
(received by all nicks in channel).
For example with these commands:
/notice nick2 [#channel] private notice
/notice #channel notice for whole channel
Old display was (on receiver side, in #channel):
-- | Notice(nick1): private notice
-- | Notice(nick1): notice for whole channel
New display is:
-- | Notice(nick1) -> nick2: private notice
-- | Notice(nick1) -> #channel: notice for whole channel
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 874e27e5e..1c96e31bd 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1060,7 +1060,7 @@ IRC_PROTOCOL_CALLBACK(notice) char *pos_target, *pos_args, *pos, end_char, *channel; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; - int notify_private, is_channel, notice_op, notice_voice; + int notify_private, is_channel, is_channel_orig, notice_op, notice_voice; struct t_gui_buffer *ptr_buffer; IRC_PROTOCOL_MIN_ARGS(3); @@ -1106,10 +1106,12 @@ IRC_PROTOCOL_CALLBACK(notice) else { is_channel = 0; + is_channel_orig = 0; channel = NULL; if (pos_target) { is_channel = irc_channel_is_channel (server, pos_target); + is_channel_orig = is_channel; if (is_channel) { channel = strdup (pos_target); @@ -1169,7 +1171,7 @@ IRC_PROTOCOL_CALLBACK(notice) irc_protocol_tags (command, "notify_message", nick), - "%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_NOTICE, /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ @@ -1180,6 +1182,9 @@ IRC_PROTOCOL_CALLBACK(notice) (nick && nick[0]) ? nick : "?", IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, + (is_channel_orig) ? IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_message (server, NULL, pos_target), + pos_target, + IRC_COLOR_RESET, pos_args); } else |