1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

Fix missing self nick display with /msg command

This commit is contained in:
Sebastien Helleu
2008-08-21 10:53:12 +02:00
parent 2c01447358
commit 9de580a85b
2 changed files with 28 additions and 48 deletions
+18 -22
View File
@@ -1812,7 +1812,10 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
string = irc_color_decode (argv_eol[2],
weechat_config_boolean (irc_config_network_colors_receive));
weechat_printf (ptr_channel->buffer,
"%s",
"%s%s",
irc_nick_as_prefix ((ptr_nick) ? ptr_nick : NULL,
(ptr_nick) ? NULL : ptr_server->nick,
IRC_COLOR_CHAT_NICK_SELF),
(string) ? string : argv_eol[2]);
if (string)
free (string);
@@ -1828,28 +1831,21 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
targets[i]);
if (ptr_channel)
{
ptr_nick = irc_nick_search (ptr_channel,
ptr_server->nick);
if (ptr_nick)
{
string = irc_color_decode (argv_eol[2],
weechat_config_boolean (irc_config_network_colors_receive));
weechat_printf (ptr_channel->buffer,
"%s",
(string) ?
string : argv_eol[2]);
if (string)
free (string);
}
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
ptr_nick = irc_nick_search (ptr_channel, ptr_server->nick);
else
{
weechat_printf (ptr_server->buffer,
_("%s%s: nick \"%s\" not "
"found for \"%s\" command"),
weechat_prefix ("error"),
"irc", ptr_server->nick,
"msg");
}
ptr_nick = NULL;
string = irc_color_decode (argv_eol[2],
weechat_config_boolean (irc_config_network_colors_receive));
weechat_printf (ptr_channel->buffer,
"%s%s",
irc_nick_as_prefix ((ptr_nick) ? ptr_nick : NULL,
(ptr_nick) ? NULL : ptr_server->nick,
IRC_COLOR_CHAT_NICK_SELF),
(string) ?
string : argv_eol[2]);
if (string)
free (string);
}
irc_server_sendf (ptr_server, "PRIVMSG %s :%s",
targets[i], argv_eol[2]);
+10 -26
View File
@@ -48,33 +48,17 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, const char *text)
if (ptr_channel)
{
if (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
{
weechat_printf (buffer,
"%s%s",
irc_nick_as_prefix (NULL, ptr_server->nick,
IRC_COLOR_CHAT_NICK_SELF),
(text_decoded) ? text_decoded : text);
}
else
{
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
ptr_nick = irc_nick_search (ptr_channel, ptr_server->nick);
if (ptr_nick)
{
weechat_printf (buffer,
"%s%s",
irc_nick_as_prefix (ptr_nick, NULL,
IRC_COLOR_CHAT_NICK_SELF),
(text_decoded) ? text_decoded : text);
}
else
{
weechat_printf (ptr_server->buffer,
_("%s%s: cannot find nick for sending "
"message"),
weechat_prefix ("error"), "irc");
}
}
else
ptr_nick = NULL;
weechat_printf (buffer,
"%s%s",
irc_nick_as_prefix ((ptr_nick) ? ptr_nick : NULL,
(ptr_nick) ? NULL : ptr_server->nick,
IRC_COLOR_CHAT_NICK_SELF),
(text_decoded) ? text_decoded : text);
}
if (text_decoded)