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
+5 -2
View File
@@ -1331,20 +1331,23 @@ plugin_script_api_bar_item_remove (struct t_weechat_plugin *weechat_plugin,
* Executes a command on a buffer (simulates user entry).
*/
void
int
plugin_script_api_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer, const char *command)
{
char *command2;
int rc;
command2 = (script->charset && script->charset[0]) ?
weechat_iconv_to_internal (script->charset, command) : NULL;
weechat_command (buffer, (command2) ? command2 : command);
rc = weechat_command (buffer, (command2) ? command2 : command);
if (command2)
free (command2);
return rc;
}
/*