1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: return value in function command(), remove WeeChat error after command callback if return code is WEECHAT_RC_ERROR

This commit is contained in:
Sébastien Helleu
2014-11-22 08:14:29 +01:00
parent e253a2509a
commit 1ef3237b6b
50 changed files with 668 additions and 562 deletions
+6 -5
View File
@@ -4249,6 +4249,7 @@ static int
weechat_lua_api_command (lua_State *L)
{
const char *buffer, *command;
int rc;
API_FUNC(1, "command", API_RETURN_ERROR);
if (lua_gettop (L) < 2)
@@ -4257,12 +4258,12 @@ weechat_lua_api_command (lua_State *L)
buffer = lua_tostring (L, -2);
command = lua_tostring (L, -1);
plugin_script_api_command (weechat_lua_plugin,
lua_current_script,
API_STR2PTR(buffer),
command);
rc = plugin_script_api_command (weechat_lua_plugin,
lua_current_script,
API_STR2PTR(buffer),
command);
API_RETURN_OK;
API_RETURN_INT(rc);
}
static int
+2 -2
View File
@@ -645,7 +645,7 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
weechat_lua_unload_all ();
}
else
return WEECHAT_RC_ERROR;
WEECHAT_COMMAND_ERROR;
}
else
{
@@ -695,7 +695,7 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
lua_quiet = 0;
}
else
return WEECHAT_RC_ERROR;
WEECHAT_COMMAND_ERROR;
}
return WEECHAT_RC_OK;