diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-01-07 12:37:04 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-01-07 12:37:04 +0100 |
commit | f3de26c0755feaa5810704ad34eb2ea069c139af (patch) | |
tree | e2c2c41f8313dbba96870e10da63e83afb072092 /src/core | |
parent | d7ca5f04f625474891161e3df34cb90a70a761b3 (diff) | |
download | weechat-f3de26c0755feaa5810704ad34eb2ea069c139af.zip |
core: set input callback on user buffers after /upgrade
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-command.c | 33 | ||||
-rw-r--r-- | src/core/wee-upgrade.c | 2 |
2 files changed, 4 insertions, 31 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 9f65b9726..a86293267 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -537,28 +537,6 @@ command_buffer_display_localvar (void *data, } /* - * Input callback for custom buffers. - */ - -int -command_buffer_input_cb (const void *pointer, - void *data, - struct t_gui_buffer *buffer, - const char *input_data) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - - if (string_strcasecmp (input_data, "q") == 0) - { - gui_buffer_close (buffer); - } - - return WEECHAT_RC_OK; -} - -/* * Callback for command "/buffer": manages buffers. */ @@ -622,12 +600,7 @@ COMMAND_CALLBACK(buffer) else arg_name = i; } - for (i = 0; gui_buffer_reserved_names[i]; i++) - { - if (strcmp (argv[arg_name], gui_buffer_reserved_names[i]) == 0) - break; - } - if (gui_buffer_reserved_names[i]) + if (gui_buffer_is_reserved_name (argv[arg_name])) { gui_chat_printf (NULL, _("%sError: name \"%s\" is reserved for WeeChat"), @@ -638,9 +611,7 @@ COMMAND_CALLBACK(buffer) ptr_buffer = gui_buffer_search_by_name (PLUGIN_CORE, argv[arg_name]); if (!ptr_buffer) { - ptr_buffer = gui_buffer_new (NULL, argv[arg_name], - &command_buffer_input_cb, NULL, NULL, - NULL, NULL, NULL); + ptr_buffer = gui_buffer_new_user (argv[arg_name]); if (ptr_buffer && type_free) gui_buffer_set (ptr_buffer, "type", "free"); } diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 3413d01b0..5afa33266 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -854,6 +854,8 @@ upgrade_weechat_load () gui_color_buffer_assign (); gui_color_buffer_display (); + gui_buffer_user_set_callbacks (); + secure_buffer_assign (); secure_buffer_display (); |