diff options
-rw-r--r-- | src/core/wee-upgrade.c | 7 | ||||
-rw-r--r-- | src/gui/gui-chat.c | 8 | ||||
-rw-r--r-- | src/gui/gui-chat.h | 9 |
3 files changed, 17 insertions, 7 deletions
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index a2fc242f5..bf4c47870 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -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: diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 657a4e46f..8701436dd 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -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; } /* diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h index c616bc526..f14e2c2a8 100644 --- a/src/gui/gui-chat.h +++ b/src/gui/gui-chat.h @@ -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, |