diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-04-09 08:03:53 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-04-09 08:03:53 +0000 |
commit | a92ca4961b00f2fca61facec743986e89446841f (patch) | |
tree | d53d6e59f33774c11d924bb1659353e4ce5392a5 | |
parent | ae8a4633efcbba8bc34072dd1b539a1b550a5341 (diff) | |
download | weechat-a92ca4961b00f2fca61facec743986e89446841f.zip |
Hotlist not changed when self away or nick change
-rw-r--r-- | src/gui/curses/gui-display.c | 3 | ||||
-rw-r--r-- | src/gui/gui-common.c | 2 | ||||
-rw-r--r-- | src/gui/gui.h | 1 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 34 | ||||
-rw-r--r-- | src/irc/irc-send.c | 2 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 3 | ||||
-rw-r--r-- | weechat/src/gui/gui-common.c | 2 | ||||
-rw-r--r-- | weechat/src/gui/gui.h | 1 | ||||
-rw-r--r-- | weechat/src/irc/irc-recv.c | 34 | ||||
-rw-r--r-- | weechat/src/irc/irc-send.c | 2 |
10 files changed, 50 insertions, 34 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 5d0c0d662..4e41b8f48 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -65,6 +65,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] = int color_attr[NUM_COLORS]; + /* * gui_assign_color: assign a color (read from config) */ @@ -2398,7 +2399,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message) pos[0] = '\n'; if (buffer->num_displayed > 0) gui_draw_buffer_chat (buffer, 0); - if (buffer->num_displayed == 0) + if (gui_add_hotlist && (buffer->num_displayed == 0)) { if (3 - buffer->last_line->line_with_message - buffer->last_line->line_with_highlight <= diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index 5e8df43e6..8136d49f3 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -43,6 +43,8 @@ int gui_init_ok = 0; /* = 1 if GUI is initialized */ int gui_ok = 0; /* = 1 if GUI is ok */ /* (0 when term size too small) */ +int gui_add_hotlist = 1; /* 0 is for temporarly disable */ + /* hotlist add for all buffers */ t_gui_window *gui_windows = NULL; /* pointer to first window */ t_gui_window *last_gui_window = NULL; /* pointer to last window */ diff --git a/src/gui/gui.h b/src/gui/gui.h index 6af18fe70..34608ff6b 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -250,6 +250,7 @@ struct t_gui_window extern int gui_init_ok; extern int gui_ok; +extern int gui_add_hotlist; extern t_gui_window *gui_windows; extern t_gui_window *last_gui_window; extern t_gui_window *gui_current_window; diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index cb066251c..b834188c9 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -740,29 +740,30 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments) if (pos) pos[0] = '\0'; + /* change nickname in any opened private window */ + for (ptr_buffer = gui_buffers; ptr_buffer; + ptr_buffer = ptr_buffer->next_buffer) + { + if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer)) + { + if ((CHANNEL(ptr_buffer)->name) + && (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0)) + { + free (CHANNEL(ptr_buffer)->name); + CHANNEL(ptr_buffer)->name = strdup (arguments); + } + } + } + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { ptr_nick = nick_search (ptr_channel, host); if (ptr_nick) { - /* change nickname in any opened private window */ - for (ptr_buffer = gui_buffers; ptr_buffer; - ptr_buffer = ptr_buffer->next_buffer) - { - if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer)) - { - if ((CHANNEL(ptr_buffer)->name) - && (strcmp (ptr_nick->nick, CHANNEL(ptr_buffer)->name) == 0)) - { - free (CHANNEL(ptr_buffer)->name); - CHANNEL(ptr_buffer)->name = strdup (arguments); - } - } - } - - /* change nickname on channel */ nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0; + if (nick_is_me) + gui_add_hotlist = 0; nick_change (ptr_channel, ptr_nick, arguments); irc_display_prefix (ptr_channel->buffer, PREFIX_INFO); if (nick_is_me) @@ -786,6 +787,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments) arguments); if (gui_buffer_has_nicklist (ptr_channel->buffer)) gui_draw_buffer_nick (ptr_channel->buffer, 1); + gui_add_hotlist = 1; } } diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index 25d3e5aea..a49ef7e4d 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -94,6 +94,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) time_t elapsed; char buffer[4096]; + gui_add_hotlist = 0; if (arguments && (strncmp (arguments, "-all", 4) == 0)) { pos = arguments + 4; @@ -184,6 +185,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) } } gui_draw_buffer_status (gui_current_window->buffer, 1); + gui_add_hotlist = 1; return 0; } diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 5d0c0d662..4e41b8f48 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -65,6 +65,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] = int color_attr[NUM_COLORS]; + /* * gui_assign_color: assign a color (read from config) */ @@ -2398,7 +2399,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message) pos[0] = '\n'; if (buffer->num_displayed > 0) gui_draw_buffer_chat (buffer, 0); - if (buffer->num_displayed == 0) + if (gui_add_hotlist && (buffer->num_displayed == 0)) { if (3 - buffer->last_line->line_with_message - buffer->last_line->line_with_highlight <= diff --git a/weechat/src/gui/gui-common.c b/weechat/src/gui/gui-common.c index 5e8df43e6..8136d49f3 100644 --- a/weechat/src/gui/gui-common.c +++ b/weechat/src/gui/gui-common.c @@ -43,6 +43,8 @@ int gui_init_ok = 0; /* = 1 if GUI is initialized */ int gui_ok = 0; /* = 1 if GUI is ok */ /* (0 when term size too small) */ +int gui_add_hotlist = 1; /* 0 is for temporarly disable */ + /* hotlist add for all buffers */ t_gui_window *gui_windows = NULL; /* pointer to first window */ t_gui_window *last_gui_window = NULL; /* pointer to last window */ diff --git a/weechat/src/gui/gui.h b/weechat/src/gui/gui.h index 6af18fe70..34608ff6b 100644 --- a/weechat/src/gui/gui.h +++ b/weechat/src/gui/gui.h @@ -250,6 +250,7 @@ struct t_gui_window extern int gui_init_ok; extern int gui_ok; +extern int gui_add_hotlist; extern t_gui_window *gui_windows; extern t_gui_window *last_gui_window; extern t_gui_window *gui_current_window; diff --git a/weechat/src/irc/irc-recv.c b/weechat/src/irc/irc-recv.c index cb066251c..b834188c9 100644 --- a/weechat/src/irc/irc-recv.c +++ b/weechat/src/irc/irc-recv.c @@ -740,29 +740,30 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments) if (pos) pos[0] = '\0'; + /* change nickname in any opened private window */ + for (ptr_buffer = gui_buffers; ptr_buffer; + ptr_buffer = ptr_buffer->next_buffer) + { + if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer)) + { + if ((CHANNEL(ptr_buffer)->name) + && (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0)) + { + free (CHANNEL(ptr_buffer)->name); + CHANNEL(ptr_buffer)->name = strdup (arguments); + } + } + } + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { ptr_nick = nick_search (ptr_channel, host); if (ptr_nick) { - /* change nickname in any opened private window */ - for (ptr_buffer = gui_buffers; ptr_buffer; - ptr_buffer = ptr_buffer->next_buffer) - { - if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer)) - { - if ((CHANNEL(ptr_buffer)->name) - && (strcmp (ptr_nick->nick, CHANNEL(ptr_buffer)->name) == 0)) - { - free (CHANNEL(ptr_buffer)->name); - CHANNEL(ptr_buffer)->name = strdup (arguments); - } - } - } - - /* change nickname on channel */ nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0; + if (nick_is_me) + gui_add_hotlist = 0; nick_change (ptr_channel, ptr_nick, arguments); irc_display_prefix (ptr_channel->buffer, PREFIX_INFO); if (nick_is_me) @@ -786,6 +787,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments) arguments); if (gui_buffer_has_nicklist (ptr_channel->buffer)) gui_draw_buffer_nick (ptr_channel->buffer, 1); + gui_add_hotlist = 1; } } diff --git a/weechat/src/irc/irc-send.c b/weechat/src/irc/irc-send.c index 25d3e5aea..a49ef7e4d 100644 --- a/weechat/src/irc/irc-send.c +++ b/weechat/src/irc/irc-send.c @@ -94,6 +94,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) time_t elapsed; char buffer[4096]; + gui_add_hotlist = 0; if (arguments && (strncmp (arguments, "-all", 4) == 0)) { pos = arguments + 4; @@ -184,6 +185,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) } } gui_draw_buffer_status (gui_current_window->buffer, 1); + gui_add_hotlist = 1; return 0; } |