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

Fixed hotlist display bug with server buffer when all servers are displayed on

same buffer (display was current server instead of server with activity)
This commit is contained in:
Sebastien Helleu
2006-01-08 19:26:51 +00:00
parent 05992a34f3
commit b3b1ab104b
12 changed files with 30 additions and 20 deletions
+2 -1
View File
@@ -76,7 +76,7 @@ hotlist_find_pos (t_weechat_hotlist *new_hotlist)
*/
void
hotlist_add (int priority, t_gui_buffer *buffer)
hotlist_add (int priority, t_irc_server *server, t_gui_buffer *buffer)
{
t_weechat_hotlist *new_hotlist, *pos_hotlist;
@@ -104,6 +104,7 @@ hotlist_add (int priority, t_gui_buffer *buffer)
}
new_hotlist->priority = priority;
new_hotlist->server = server;
new_hotlist->buffer = buffer;
if (hotlist)
+2 -1
View File
@@ -34,6 +34,7 @@ struct t_weechat_hotlist
{
int priority; /* 0=crappy msg (join/part), 1=msg, */
/* 2=pv, 3=nick highlight */
t_irc_server *server; /* associated server */
t_gui_buffer *buffer; /* associated buffer */
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
@@ -42,7 +43,7 @@ struct t_weechat_hotlist
extern t_weechat_hotlist *hotlist;
extern t_gui_buffer *hotlist_initial_buffer;
extern void hotlist_add (int, t_gui_buffer *);
extern void hotlist_add (int, t_irc_server *, t_gui_buffer *);
extern void hotlist_free (t_weechat_hotlist *);
extern void hotlist_free_all ();
extern void hotlist_remove_buffer (t_gui_buffer *);
+4 -1
View File
@@ -2164,7 +2164,10 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, SERVER(ptr_hotlist->buffer)->name);
wprintw (ptr_win->win_status, format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
+4 -4
View File
@@ -844,13 +844,13 @@ gui_add_to_line (t_gui_buffer *buffer, int type, char *message)
buffer->notify_level)
{
if (buffer->last_line->line_with_highlight)
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
hotlist_add (HOTLIST_HIGHLIGHT, SERVER(buffer), buffer);
else if (BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
hotlist_add (HOTLIST_PRIVATE, buffer);
hotlist_add (HOTLIST_PRIVATE, SERVER(buffer), buffer);
else if (buffer->last_line->line_with_message)
hotlist_add (HOTLIST_MSG, buffer);
hotlist_add (HOTLIST_MSG, SERVER(buffer), buffer);
else
hotlist_add (HOTLIST_LOW, buffer);
hotlist_add (HOTLIST_LOW, SERVER(buffer), buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ dcc_redraw (int highlight)
gui_redraw_buffer (gui_get_dcc_buffer (gui_current_window));
if (highlight)
{
hotlist_add (highlight, gui_get_dcc_buffer (gui_current_window));
hotlist_add (highlight, NULL, gui_get_dcc_buffer (gui_current_window));
gui_draw_buffer_status (gui_current_window->buffer, 0);
}
}
+2 -2
View File
@@ -365,7 +365,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *nick, char *argumen
GUI_COLOR(COLOR_WIN_CHAT),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
nick);
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
hotlist_add (HOTLIST_HIGHLIGHT, server, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
@@ -1290,7 +1290,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
(ascii_strcasecmp (nick, "chanserv") != 0) &&
(ascii_strcasecmp (nick, "memoserv") != 0))
{
hotlist_add (HOTLIST_PRIVATE, server->buffer);
hotlist_add (HOTLIST_PRIVATE, server, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+2 -1
View File
@@ -76,7 +76,7 @@ hotlist_find_pos (t_weechat_hotlist *new_hotlist)
*/
void
hotlist_add (int priority, t_gui_buffer *buffer)
hotlist_add (int priority, t_irc_server *server, t_gui_buffer *buffer)
{
t_weechat_hotlist *new_hotlist, *pos_hotlist;
@@ -104,6 +104,7 @@ hotlist_add (int priority, t_gui_buffer *buffer)
}
new_hotlist->priority = priority;
new_hotlist->server = server;
new_hotlist->buffer = buffer;
if (hotlist)
+2 -1
View File
@@ -34,6 +34,7 @@ struct t_weechat_hotlist
{
int priority; /* 0=crappy msg (join/part), 1=msg, */
/* 2=pv, 3=nick highlight */
t_irc_server *server; /* associated server */
t_gui_buffer *buffer; /* associated buffer */
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
@@ -42,7 +43,7 @@ struct t_weechat_hotlist
extern t_weechat_hotlist *hotlist;
extern t_gui_buffer *hotlist_initial_buffer;
extern void hotlist_add (int, t_gui_buffer *);
extern void hotlist_add (int, t_irc_server *, t_gui_buffer *);
extern void hotlist_free (t_weechat_hotlist *);
extern void hotlist_free_all ();
extern void hotlist_remove_buffer (t_gui_buffer *);
+4 -1
View File
@@ -2164,7 +2164,10 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, SERVER(ptr_hotlist->buffer)->name);
wprintw (ptr_win->win_status, format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
+4 -4
View File
@@ -844,13 +844,13 @@ gui_add_to_line (t_gui_buffer *buffer, int type, char *message)
buffer->notify_level)
{
if (buffer->last_line->line_with_highlight)
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
hotlist_add (HOTLIST_HIGHLIGHT, SERVER(buffer), buffer);
else if (BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
hotlist_add (HOTLIST_PRIVATE, buffer);
hotlist_add (HOTLIST_PRIVATE, SERVER(buffer), buffer);
else if (buffer->last_line->line_with_message)
hotlist_add (HOTLIST_MSG, buffer);
hotlist_add (HOTLIST_MSG, SERVER(buffer), buffer);
else
hotlist_add (HOTLIST_LOW, buffer);
hotlist_add (HOTLIST_LOW, SERVER(buffer), buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ dcc_redraw (int highlight)
gui_redraw_buffer (gui_get_dcc_buffer (gui_current_window));
if (highlight)
{
hotlist_add (highlight, gui_get_dcc_buffer (gui_current_window));
hotlist_add (highlight, NULL, gui_get_dcc_buffer (gui_current_window));
gui_draw_buffer_status (gui_current_window->buffer, 0);
}
}
+2 -2
View File
@@ -365,7 +365,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *nick, char *argumen
GUI_COLOR(COLOR_WIN_CHAT),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
nick);
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
hotlist_add (HOTLIST_HIGHLIGHT, server, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
@@ -1290,7 +1290,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
(ascii_strcasecmp (nick, "chanserv") != 0) &&
(ascii_strcasecmp (nick, "memoserv") != 0))
{
hotlist_add (HOTLIST_PRIVATE, server->buffer);
hotlist_add (HOTLIST_PRIVATE, server, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}