1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 17:53:13 +02:00

irc: display channel voice notices received in channel buffer (bug #34762), display channel/op notices sent in channel buffer

This commit is contained in:
Sebastien Helleu
2011-11-07 10:24:28 +01:00
parent cdcd417774
commit e8e5ad66cc
3 changed files with 34 additions and 12 deletions
+12 -3
View File
@@ -942,7 +942,7 @@ IRC_PROTOCOL_CALLBACK(notice)
char *pos_target, *pos_args;
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
int notify_private, notice_op;
int notify_private, is_channel, notice_op, notice_voice;
struct t_gui_buffer *ptr_buffer;
/*
@@ -958,20 +958,29 @@ IRC_PROTOCOL_CALLBACK(notice)
return WEECHAT_RC_OK;
notice_op = 0;
notice_voice = 0;
if (argv[0][0] == ':')
{
if (argc < 4)
return WEECHAT_RC_ERROR;
pos_target = argv[2];
if ((pos_target[0] == '@') && (irc_channel_is_channel (pos_target + 1)))
is_channel = irc_channel_is_channel (pos_target + 1);
if ((pos_target[0] == '@') && is_channel)
{
pos_target++;
notice_op = 1;
}
else if ((pos_target[0] == '+') && is_channel)
{
pos_target++;
notice_voice = 1;
}
pos_args = (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3];
if (notice_op && (pos_args[0] == '@') && (pos_args[1] == ' '))
pos_args += 2;
else if (notice_voice && (pos_args[0] == '+') && (pos_args[1] == ' '))
pos_args += 2;
}
else
{
@@ -1000,7 +1009,7 @@ IRC_PROTOCOL_CALLBACK(notice)
IRC_COLOR_NOTICE,
/* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */
_("Notice"),
(notice_op) ? "Op" : "",
(notice_op) ? "Op" : ((notice_voice) ? "Voice" : ""),
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
(nick && nick[0]) ? nick : "?",