1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +02:00

irc: display privmsg messages to "@#channel" and "+#channel" in channel buffer (bug #35331)

This commit is contained in:
Sebastien Helleu
2012-03-14 20:33:12 +01:00
parent d4ba6ac1c4
commit 3e602195e9
3 changed files with 104 additions and 22 deletions
+41 -6
View File
@@ -2499,7 +2499,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
char **targets;
int num_targets, i, arg_target, arg_text;
int num_targets, i, arg_target, arg_text, is_channel, msg_op_voice;
char *msg_pwd_hidden;
char *string;
@@ -2561,16 +2561,51 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
if (irc_channel_is_channel (ptr_server, targets[i]))
is_channel = 0;
ptr_channel = NULL;
msg_op_voice = 0;
if (((targets[i][0] == '@') || (targets[i][0] == '+'))
&& irc_channel_is_channel (ptr_server, targets[i] + 1))
{
ptr_channel = irc_channel_search (ptr_server, targets[i] + 1);
is_channel = 1;
msg_op_voice = 1;
}
else
{
ptr_channel = irc_channel_search (ptr_server, targets[i]);
if (ptr_channel)
is_channel = 1;
}
if (is_channel)
{
ptr_channel = irc_channel_search (ptr_server,
targets[i]);
if (ptr_channel)
{
string = irc_color_decode (argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_receive));
irc_input_user_message_display (ptr_channel->buffer,
(string) ? string : argv_eol[arg_text]);
if (msg_op_voice)
{
/*
* message to channel ops/voiced
* (to "@#channel" or "+#channel")
*/
weechat_printf_tags (ptr_channel->buffer,
"notify_none,no_highlight",
"%s%s%s -> %s%s%s: %s",
weechat_prefix ("network"),
_("Msg"),
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
targets[i],
IRC_COLOR_RESET,
(string) ? string : argv_eol[arg_text]);
}
else
{
/* standard message (to "#channel") */
irc_input_user_message_display (ptr_channel->buffer,
(string) ? string : argv_eol[arg_text]);
}
if (string)
free (string);
}