mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
Fix highlight on lines displayed with /upgrade
This commit is contained in:
@@ -283,6 +283,7 @@ upgrade_weechat_read_cb (int object_id,
|
||||
char *option_key, *var_name, *option_var;
|
||||
struct t_gui_nick_group *ptr_group;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
struct t_gui_line *new_line;
|
||||
struct timeval creation_time;
|
||||
void *buf;
|
||||
int size, index, length;
|
||||
@@ -389,13 +390,17 @@ upgrade_weechat_read_cb (int object_id,
|
||||
/* add line to current buffer */
|
||||
if (upgrade_current_buffer)
|
||||
{
|
||||
gui_chat_line_add (
|
||||
new_line = gui_chat_line_add (
|
||||
upgrade_current_buffer,
|
||||
infolist_time (infolist, "date"),
|
||||
infolist_time (infolist, "date_printed"),
|
||||
infolist_string (infolist, "tags"),
|
||||
infolist_string (infolist, "prefix"),
|
||||
infolist_string (infolist, "message"));
|
||||
if (new_line)
|
||||
{
|
||||
new_line->highlight = infolist_integer (infolist, "highlight");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UPGRADE_WEECHAT_TYPE_NICKLIST:
|
||||
|
||||
+5
-3
@@ -628,7 +628,7 @@ gui_chat_line_has_highlight (struct t_gui_buffer *buffer,
|
||||
{
|
||||
int rc;
|
||||
char *msg_no_color;
|
||||
|
||||
|
||||
/* highlights are disabled on this buffer? (special value "-" means that
|
||||
buffer does not want any highlight) */
|
||||
if (buffer->highlight_words && (strcmp (buffer->highlight_words, "-") == 0))
|
||||
@@ -763,7 +763,7 @@ gui_chat_line_get_notify_level (struct t_gui_line *line)
|
||||
* gui_chat_line_add: add a new line for a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
struct t_gui_line *
|
||||
gui_chat_line_add (struct t_gui_buffer *buffer, time_t date,
|
||||
time_t date_printed, const char *tags,
|
||||
const char *prefix, const char *message)
|
||||
@@ -775,7 +775,7 @@ gui_chat_line_add (struct t_gui_buffer *buffer, time_t date,
|
||||
if (!new_line)
|
||||
{
|
||||
log_printf (_("Not enough memory for new line"));
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* fill data in new line */
|
||||
@@ -852,6 +852,8 @@ gui_chat_line_add (struct t_gui_buffer *buffer, time_t date,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new_line;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+6
-3
@@ -77,9 +77,12 @@ extern int gui_chat_line_match_tags (struct t_gui_line *line, int tags_count,
|
||||
extern void gui_chat_line_free (struct t_gui_buffer *buffer,
|
||||
struct t_gui_line *line);
|
||||
extern void gui_chat_line_free_all (struct t_gui_buffer *buffer);
|
||||
extern void gui_chat_line_add (struct t_gui_buffer *buffer, time_t date,
|
||||
time_t date_printed, const char *tags,
|
||||
const char *prefix, const char *message);
|
||||
extern struct t_gui_line *gui_chat_line_add (struct t_gui_buffer *buffer,
|
||||
time_t date,
|
||||
time_t date_printed,
|
||||
const char *tags,
|
||||
const char *prefix,
|
||||
const char *message);
|
||||
extern void gui_chat_line_add_y (struct t_gui_buffer *buffer, int y,
|
||||
const char *message);
|
||||
extern void gui_chat_printf_date_tags (struct t_gui_buffer *buffer,
|
||||
|
||||
Reference in New Issue
Block a user