diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-02-28 15:59:33 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-02-28 15:59:33 +0000 |
commit | 8c662f69f97d1adfd83c8fd7b6427bdfa386ca98 (patch) | |
tree | 0a585b145cf76fea5ddae8a007667838382a471c | |
parent | 5c29def9d961ae45eaf2732ead01ee155a4a2596 (diff) | |
download | weechat-8c662f69f97d1adfd83c8fd7b6427bdfa386ca98.zip |
/msg command does not open any buffer any more
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/irc/irc-send.c | 50 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/irc/irc-send.c | 50 |
4 files changed, 54 insertions, 52 deletions
@@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-02-26 +ChangeLog - 2006-02-28 Version 0.1.8 (under dev!): + * /msg command does not open any buffer any more * fixed crash when using global history (when older entry is removed) * added IRC raw data buffer (new key: alt-J + alt-R) * fixed display bug with /kill command diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index 591ab496f..b021714cf 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -1220,34 +1220,34 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel, return 0; } + string = (char *)gui_color_decode ((unsigned char *)pos, 1); ptr_channel = channel_search (server, arguments); - if (!ptr_channel) + if (ptr_channel) { - ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, arguments); - if (!ptr_channel) - { - irc_display_prefix (NULL, server->buffer, PREFIX_ERROR); - gui_printf_nolog (server->buffer, - _("%s cannot create new private buffer \"%s\"\n"), - WEECHAT_ERROR, arguments); - return -1; - } - gui_buffer_new (window, server, ptr_channel, - BUFFER_TYPE_STANDARD, 1); - gui_draw_buffer_title (ptr_channel->buffer, 1); + gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK, + "%s<%s%s%s> ", + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_NICK_SELF), + server->nick, + GUI_COLOR(COLOR_WIN_CHAT_DARK)); + gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, + "%s%s\n", + GUI_COLOR(COLOR_WIN_CHAT), + (string) ? string : ""); + } + else + { + irc_display_prefix (server, server->buffer, PREFIX_SERVER); + gui_printf (server->buffer, "MSG%s(%s%s%s)%s: ", + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT_NICK), + arguments, + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT)); + gui_printf_type (server->buffer, MSG_TYPE_MSG, + "%s\n", + (string) ? string : pos); } - - gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK, - "%s<%s%s%s> ", - GUI_COLOR(COLOR_WIN_CHAT_DARK), - GUI_COLOR(COLOR_WIN_NICK_SELF), - server->nick, - GUI_COLOR(COLOR_WIN_CHAT_DARK)); - string = (char *)gui_color_decode ((unsigned char *)pos, 1); - gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, - "%s%s\n", - GUI_COLOR(COLOR_WIN_CHAT), - (string) ? string : ""); if (string) free (string); server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos); diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 10f1cac09..c6bcf0940 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-02-26 +ChangeLog - 2006-02-28 Version 0.1.8 (under dev!): + * /msg command does not open any buffer any more * fixed crash when using global history (when older entry is removed) * added IRC raw data buffer (new key: alt-J + alt-R) * fixed display bug with /kill command diff --git a/weechat/src/irc/irc-send.c b/weechat/src/irc/irc-send.c index 591ab496f..b021714cf 100644 --- a/weechat/src/irc/irc-send.c +++ b/weechat/src/irc/irc-send.c @@ -1220,34 +1220,34 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel, return 0; } + string = (char *)gui_color_decode ((unsigned char *)pos, 1); ptr_channel = channel_search (server, arguments); - if (!ptr_channel) + if (ptr_channel) { - ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, arguments); - if (!ptr_channel) - { - irc_display_prefix (NULL, server->buffer, PREFIX_ERROR); - gui_printf_nolog (server->buffer, - _("%s cannot create new private buffer \"%s\"\n"), - WEECHAT_ERROR, arguments); - return -1; - } - gui_buffer_new (window, server, ptr_channel, - BUFFER_TYPE_STANDARD, 1); - gui_draw_buffer_title (ptr_channel->buffer, 1); + gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK, + "%s<%s%s%s> ", + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_NICK_SELF), + server->nick, + GUI_COLOR(COLOR_WIN_CHAT_DARK)); + gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, + "%s%s\n", + GUI_COLOR(COLOR_WIN_CHAT), + (string) ? string : ""); + } + else + { + irc_display_prefix (server, server->buffer, PREFIX_SERVER); + gui_printf (server->buffer, "MSG%s(%s%s%s)%s: ", + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT_NICK), + arguments, + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT)); + gui_printf_type (server->buffer, MSG_TYPE_MSG, + "%s\n", + (string) ? string : pos); } - - gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK, - "%s<%s%s%s> ", - GUI_COLOR(COLOR_WIN_CHAT_DARK), - GUI_COLOR(COLOR_WIN_NICK_SELF), - server->nick, - GUI_COLOR(COLOR_WIN_CHAT_DARK)); - string = (char *)gui_color_decode ((unsigned char *)pos, 1); - gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, - "%s%s\n", - GUI_COLOR(COLOR_WIN_CHAT), - (string) ? string : ""); if (string) free (string); server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos); |