diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-12 10:37:04 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-12 10:37:04 +0200 |
commit | 0c9051f38a3568bc2805e33cedcd64cdf2ac9c85 (patch) | |
tree | 2fd25d34a61b4f785e813ae73e6781312c6b3295 /src/plugins/irc/irc-command.c | |
parent | 60d239c8f7c54dd3e654d2f80b713f75eb20bca3 (diff) | |
download | weechat-0c9051f38a3568bc2805e33cedcd64cdf2ac9c85.zip |
Fixed IRC /msg command (text was sent twice when sending "nickserv identify")
Diffstat (limited to 'src/plugins/irc/irc-command.c')
-rw-r--r-- | src/plugins/irc/irc-command.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 7b14bb576..2d0904dd6 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -1766,9 +1766,6 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, ptr_nick = irc_nick_search (ptr_channel, ptr_server->nick); else ptr_nick = NULL; - //irc_display_nick (ptr_channel->buffer, ptr_nick, - // (ptr_nick) ? NULL : ptr_server->nick, - // GUI_MSG_TYPE_NICK, 1, NULL, 0); string = (char *)irc_color_decode ((unsigned char *)argv_eol[2], 1, 0); weechat_printf (ptr_channel->buffer, @@ -1792,9 +1789,6 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, ptr_server->nick); if (ptr_nick) { - //irc_display_nick (ptr_channel->buffer, ptr_nick, - // NULL, GUI_MSG_TYPE_NICK, 1, - // NULL, 0); string = (char *)irc_color_decode ( (unsigned char *)argv_eol[2], 1, 0); weechat_printf (ptr_channel->buffer, @@ -1845,40 +1839,35 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, free (string); if (msg_pwd_hidden) free (msg_pwd_hidden); - irc_server_sendf (ptr_server, "PRIVMSG %s :%s", - targets[i], argv_eol[2]); - } - - string = (char *)irc_color_decode ( - (unsigned char *)argv_eol[2], 1, 0); - ptr_channel = irc_channel_search (ptr_server, - targets[i]); - if (ptr_channel) - { - //irc_display_nick (ptr_channel->buffer, NULL, - // ptr_server->nick, - // GUI_MSG_TYPE_NICK, 1, - // GUI_COLOR(GUI_CHAT_NICK_SELF), - // 0); - weechat_printf (ptr_channel->buffer, - "%s%s", - IRC_COLOR_CHAT, - (string) ? string : argv_eol[2]); } else { - weechat_printf (ptr_server->buffer, - "%sMSG%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, - targets[i], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT, - (string) ? string : argv_eol[2]); + string = (char *)irc_color_decode ( + (unsigned char *)argv_eol[2], 1, 0); + ptr_channel = irc_channel_search (ptr_server, + targets[i]); + if (ptr_channel) + { + weechat_printf (ptr_channel->buffer, + "%s%s", + IRC_COLOR_CHAT, + (string) ? string : argv_eol[2]); + } + else + { + weechat_printf (ptr_server->buffer, + "%sMSG%s(%s%s%s)%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_NICK, + targets[i], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT, + (string) ? string : argv_eol[2]); + } + if (string) + free (string); } - if (string) - free (string); irc_server_sendf (ptr_server, "PRIVMSG %s :%s", targets[i], argv_eol[2]); } |