mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
Fix /upgrade when there is one buffer for all IRC servers
This commit is contained in:
+28
-4
@@ -171,6 +171,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
|
||||
|
||||
/* highlight */
|
||||
new_buffer->highlight_words = NULL;
|
||||
new_buffer->highlight_tags = NULL;
|
||||
new_buffer->highlight_tags_count = 0;
|
||||
new_buffer->highlight_tags_array = NULL;
|
||||
|
||||
@@ -481,17 +482,24 @@ void
|
||||
gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer,
|
||||
const char *new_highlight_tags)
|
||||
{
|
||||
if (buffer->highlight_tags)
|
||||
free (buffer->highlight_tags);
|
||||
if (buffer->highlight_tags_array)
|
||||
string_free_exploded (buffer->highlight_tags_array);
|
||||
|
||||
if (new_highlight_tags)
|
||||
{
|
||||
buffer->highlight_tags_array = string_explode (new_highlight_tags,
|
||||
",", 0, 0,
|
||||
&buffer->highlight_tags_count);
|
||||
buffer->highlight_tags = strdup (new_highlight_tags);
|
||||
if (buffer->highlight_tags)
|
||||
{
|
||||
buffer->highlight_tags_array = string_explode (new_highlight_tags,
|
||||
",", 0, 0,
|
||||
&buffer->highlight_tags_count);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer->highlight_tags = NULL;
|
||||
buffer->highlight_tags_count = 0;
|
||||
buffer->highlight_tags_array = NULL;
|
||||
}
|
||||
@@ -1148,7 +1156,9 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_infolist_item *ptr_item;
|
||||
char *pos_point;
|
||||
struct t_gui_key *ptr_key;
|
||||
char *pos_point, option_name[32];
|
||||
int i;
|
||||
|
||||
if (!infolist || !buffer)
|
||||
return 0;
|
||||
@@ -1196,6 +1206,20 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist,
|
||||
return 0;
|
||||
if (!infolist_new_var_string (ptr_item, "input_string", buffer->input_buffer))
|
||||
return 0;
|
||||
if (!infolist_new_var_string (ptr_item, "highlight_words", buffer->highlight_words))
|
||||
return 0;
|
||||
if (!infolist_new_var_string (ptr_item, "highlight_tags", buffer->highlight_tags))
|
||||
return 0;
|
||||
i = 0;
|
||||
for (ptr_key = buffer->keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
snprintf (option_name, sizeof (option_name), "key_%05d", i);
|
||||
if (!infolist_new_var_string (ptr_item, option_name, ptr_key->key))
|
||||
return 0;
|
||||
snprintf (option_name, sizeof (option_name), "key_command_%05d", i);
|
||||
if (!infolist_new_var_string (ptr_item, option_name, ptr_key->command))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ struct t_gui_buffer
|
||||
|
||||
/* highlight settings for buffer */
|
||||
char *highlight_words; /* list of words to highlight */
|
||||
char *highlight_tags; /* tags to highlight */
|
||||
int highlight_tags_count; /* number of tags to highlight */
|
||||
/* (if 0, any tag is highlighted) */
|
||||
char **highlight_tags_array; /* tags to highlight */
|
||||
@@ -202,6 +203,10 @@ extern void gui_buffer_set_nicklist (struct t_gui_buffer *buffer,
|
||||
extern void gui_buffer_set_nicklist_case_sensitive (struct t_gui_buffer * buffer,
|
||||
int case_sensitive);
|
||||
extern void gui_buffer_set_nick (struct t_gui_buffer *buffer, const char *new_nick);
|
||||
extern void gui_buffer_set_highlight_words (struct t_gui_buffer *buffer,
|
||||
const char *new_highlight_words);
|
||||
extern void gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer,
|
||||
const char *new_highlight_tags);
|
||||
extern void gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
|
||||
void *value);
|
||||
extern struct t_gui_buffer *gui_buffer_search_main ();
|
||||
|
||||
Reference in New Issue
Block a user