summaryrefslogtreecommitdiff
path: root/src/gui/gui-buffer.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-15 16:33:31 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-15 16:33:31 +0100
commitda748fc653a4d35cc24a7b9dd1c25a4a3b07f4ee (patch)
tree5a2fdaffd42ab1a6c6cf8470add9ac06407e254e /src/gui/gui-buffer.c
parent21110ac1283c10a104b24358516c6fd98f6ce03a (diff)
downloadweechat-da748fc653a4d35cc24a7b9dd1c25a4a3b07f4ee.zip
Reintroduce option "irc.network.send_unknown_commands", save extra data for buffers with /upgrade (title, input data, text search)
Diffstat (limited to 'src/gui/gui-buffer.c')
-rw-r--r--src/gui/gui-buffer.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 9778ab38c..6ebb44ea8 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -316,6 +316,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->input = 1;
new_buffer->input_callback = input_callback;
new_buffer->input_callback_data = input_callback_data;
+ new_buffer->input_get_unknown_commands = 0;
new_buffer->input_buffer_alloc = GUI_BUFFER_INPUT_BLOCK_SIZE;
new_buffer->input_buffer = malloc (GUI_BUFFER_INPUT_BLOCK_SIZE);
new_buffer->input_buffer[0] = '\0';
@@ -750,6 +751,18 @@ gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer,
}
/*
+ * gui_buffer_set_input_get_unknown_commands: set "input_get_unknown_commands"
+ * flag for a buffer
+ */
+
+void
+gui_buffer_set_input_get_unknown_commands (struct t_gui_buffer *buffer,
+ int input_get_unknown_commands)
+{
+ buffer->input_get_unknown_commands = (input_get_unknown_commands) ? 1 : 0;
+}
+
+/*
* gui_buffer_set_unread: set unread marker for a buffer
*/
@@ -892,6 +905,13 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
gui_input_text_changed_signal ();
gui_buffer_ask_input_refresh (buffer, 1);
}
+ else if (string_strcasecmp (property, "input_get_unknown_commands") == 0)
+ {
+ error = NULL;
+ number = strtol (value, &error, 10);
+ if (error && !error[0])
+ gui_buffer_set_input_get_unknown_commands (buffer, number);
+ }
else if (string_strncasecmp (property, "localvar_set_", 13) == 0)
{
if (value)
@@ -1483,7 +1503,27 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!infolist_new_var_integer (ptr_item, "input", buffer->input))
return 0;
- if (!infolist_new_var_string (ptr_item, "input_string", buffer->input_buffer))
+ if (!infolist_new_var_integer (ptr_item, "input_get_unknown_commands", buffer->input_get_unknown_commands))
+ return 0;
+ if (!infolist_new_var_string (ptr_item, "input_buffer", buffer->input_buffer))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "input_buffer_alloc", buffer->input_buffer_alloc))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "input_buffer_size", buffer->input_buffer_size))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "input_buffer_length", buffer->input_buffer_length))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "input_buffer_pos", buffer->input_buffer_pos))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "input_buffer_1st_display", buffer->input_buffer_1st_display))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "text_search", buffer->text_search))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "text_search_exact", buffer->text_search_exact))
+ return 0;
+ if (!infolist_new_var_integer (ptr_item, "text_search_found", buffer->text_search_found))
+ return 0;
+ if (!infolist_new_var_string (ptr_item, "text_search_input", buffer->text_search_input))
return 0;
if (!infolist_new_var_string (ptr_item, "highlight_words", buffer->highlight_words))
return 0;
@@ -1700,6 +1740,7 @@ gui_buffer_print_log ()
log_printf (" input. . . . . . . . . : %d", ptr_buffer->input);
log_printf (" input_callback . . . . : 0x%lx", ptr_buffer->input_callback);
log_printf (" input_callback_data. . : 0x%lx", ptr_buffer->input_callback_data);
+ log_printf (" input_get_unknown_cmd. : %d", ptr_buffer->input_get_unknown_commands);
log_printf (" input_buffer . . . . . : '%s'", ptr_buffer->input_buffer);
log_printf (" input_buffer_alloc . . : %d", ptr_buffer->input_buffer_alloc);
log_printf (" input_buffer_size. . . : %d", ptr_buffer->input_buffer_size);