summaryrefslogtreecommitdiff
path: root/src/core/wee-command.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-01-07 12:37:04 +0100
committerSébastien Helleu <flashcode@flashtux.org>2018-01-07 12:37:04 +0100
commitf3de26c0755feaa5810704ad34eb2ea069c139af (patch)
treee2c2c41f8313dbba96870e10da63e83afb072092 /src/core/wee-command.c
parentd7ca5f04f625474891161e3df34cb90a70a761b3 (diff)
downloadweechat-f3de26c0755feaa5810704ad34eb2ea069c139af.zip
core: set input callback on user buffers after /upgrade
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r--src/core/wee-command.c33
1 files changed, 2 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");
}