diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-04-03 16:01:10 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-04-03 16:01:10 +0000 |
commit | 5068f4d3657060316954a1c6564f710c4aed70fc (patch) | |
tree | 3ce04f0f144d45895a93de83e695f42d72fcef8a /src | |
parent | 212ec7a76dbc408abec8af508e8ba55a02129b12 (diff) | |
download | weechat-5068f4d3657060316954a1c6564f710c4aed70fc.zip |
Added nick alignment in DCC chat, /query and /msg, fixed DCC chat bug when closing buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/irc-channel.c | 1 | ||||
-rw-r--r-- | src/irc/irc-dcc.c | 25 | ||||
-rw-r--r-- | src/irc/irc-display.c | 4 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 10 | ||||
-rw-r--r-- | src/irc/irc-send.c | 18 |
5 files changed, 22 insertions, 36 deletions
diff --git a/src/irc/irc-channel.c b/src/irc/irc-channel.c index 547a8075f..5901eee65 100644 --- a/src/irc/irc-channel.c +++ b/src/irc/irc-channel.c @@ -98,6 +98,7 @@ channel_free (t_irc_server *server, t_irc_channel *channel) if ((t_irc_dcc *)(channel->dcc_chat) && (!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status))) { + ((t_irc_dcc *)(channel->dcc_chat))->channel = NULL; dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED); dcc_redraw (1); } diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c index 4a9d8593e..d1bf045c0 100644 --- a/src/irc/irc-dcc.c +++ b/src/irc/irc-dcc.c @@ -1209,30 +1209,25 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc) ptr_buf_color = (char *)gui_color_decode ((ptr_buf2) ? (unsigned char *)ptr_buf2 : (unsigned char *)ptr_buf, cfg_irc_colors_receive); - gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_NICK, - "%s<", GUI_COLOR(COLOR_WIN_CHAT_DARK)); + if (irc_is_highlight (ptr_buf, ptr_dcc->server->nick)) { - gui_printf_type (ptr_dcc->channel->buffer, - MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, - "%s%s", - GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT), - ptr_dcc->nick); - if ( (cfg_look_infobar_delay_highlight > 0) - && (ptr_dcc->channel->buffer != gui_current_window->buffer) ) + irc_display_nick (ptr_dcc->channel->buffer, NULL, ptr_dcc->nick, + MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1, + COLOR_WIN_CHAT_HIGHLIGHT, 0); + if ((cfg_look_infobar_delay_highlight > 0) + && (ptr_dcc->channel->buffer != gui_current_window->buffer)) + { gui_infobar_printf (cfg_look_infobar_delay_highlight, COLOR_WIN_INFOBAR_HIGHLIGHT, _("Private %s> %s"), ptr_dcc->nick, (ptr_buf_color) ? ptr_buf_color : ((ptr_buf2) ? ptr_buf2 : ptr_buf)); + } } else - gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_NICK, - "%s%s", - GUI_COLOR(COLOR_WIN_NICK_PRIVATE), - ptr_dcc->nick); - gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_NICK, - "%s> ", GUI_COLOR(COLOR_WIN_CHAT_DARK)); + irc_display_nick (ptr_dcc->channel->buffer, NULL, ptr_dcc->nick, + MSG_TYPE_NICK, 1, COLOR_WIN_NICK_PRIVATE, 0); gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_MSG, "%s%s\n", GUI_COLOR(COLOR_WIN_CHAT), diff --git a/src/irc/irc-display.c b/src/irc/irc-display.c index 8df43f818..124549571 100644 --- a/src/irc/irc-display.c +++ b/src/irc/irc-display.c @@ -244,9 +244,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname, "%s%s", (force_color >= 0) ? GUI_COLOR(force_color) : - GUI_COLOR((nick) ? nick->color : - (buffer && BUFFER_IS_PRIVATE(buffer)) ? - COLOR_WIN_NICK_PRIVATE : COLOR_WIN_CHAT), + GUI_COLOR((nick) ? nick->color : COLOR_WIN_CHAT), ptr_nickname); if (display_around && (spaces < 0)) gui_printf_type (buffer, type, "%s+", diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index d0690564b..5c24a4732 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -2356,14 +2356,10 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume ptr_channel->topic = strdup (host2); if (irc_is_highlight (pos, server->nick)) + { irc_display_nick (ptr_channel->buffer, NULL, nick, MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1, COLOR_WIN_CHAT_HIGHLIGHT, 0); - else - irc_display_nick (ptr_channel->buffer, NULL, nick, - MSG_TYPE_NICK, 1, -1, 0); - if (irc_is_highlight (pos, server->nick)) - { if ((cfg_look_infobar_delay_highlight > 0) && (ptr_channel->buffer != gui_current_window->buffer)) gui_infobar_printf_from_buffer (ptr_channel->buffer, @@ -2374,7 +2370,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume highlight = 1; } else + { + irc_display_nick (ptr_channel->buffer, NULL, nick, + MSG_TYPE_NICK, 1, COLOR_WIN_NICK_PRIVATE, 0); highlight = 0; + } gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s%s\n", GUI_COLOR(COLOR_WIN_CHAT), diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index 7eb9979bf..31bed5956 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -1363,12 +1363,8 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel, ptr_channel = channel_search (server, arguments); if (ptr_channel) { - 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)); + irc_display_nick (ptr_channel->buffer, NULL, server->nick, + MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0); gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s%s\n", GUI_COLOR(COLOR_WIN_CHAT), @@ -1762,13 +1758,9 @@ irc_cmd_send_query (t_irc_server *server, t_irc_channel *channel, /* display text if given */ if (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)); + { + irc_display_nick (ptr_channel->buffer, NULL, server->nick, + MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0); string = (char *)gui_color_decode ((unsigned char *)pos, 1); gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s%s\n", |