diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-05-08 10:49:20 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-05-08 10:51:30 +0200 |
commit | 88bef0b1b127f67149060fe36757940379d7f4a3 (patch) | |
tree | 0f71e6a7c1b6c322013d78eb0f48aa753cd246af /src/plugins/javascript | |
parent | b7765ed9606f17e83ccd9e6aa96a1ca88294952e (diff) | |
download | weechat-88bef0b1b127f67149060fe36757940379d7f4a3.zip |
core: rename functions hook_completion_{get_string|list_add} to completion_{get_string|list_add}
Old functions are kept for compatibility reasons.
Diffstat (limited to 'src/plugins/javascript')
-rw-r--r-- | src/plugins/javascript/weechat-js-api.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp index 275c38592..19e33c431 100644 --- a/src/plugins/javascript/weechat-js-api.cpp +++ b/src/plugins/javascript/weechat-js-api.cpp @@ -1948,6 +1948,11 @@ API_FUNC(hook_completion) API_RETURN_STRING(result); } +/* + * This function deprecated since WeeChat 2.9, kept for compatibility. + * It is replaced by completion_get_string. + */ + API_FUNC(hook_completion_get_string) { const char *result; @@ -1964,6 +1969,11 @@ API_FUNC(hook_completion_get_string) API_RETURN_STRING(result); } +/* + * This function deprecated since WeeChat 2.9, kept for compatibility. + * It is replaced by completion_list_add. + */ + API_FUNC(hook_completion_list_add) { int nick_completion; @@ -4033,6 +4043,42 @@ API_FUNC(completion_search) API_RETURN_INT(rc); } +API_FUNC(completion_get_string) +{ + const char *result; + + API_INIT_FUNC(1, "completion_get_string", "ss", API_RETURN_EMPTY); + + v8::String::Utf8Value completion(args[0]); + v8::String::Utf8Value property(args[1]); + + result = weechat_completion_get_string ( + (struct t_gui_completion *)API_STR2PTR(*completion), + *property); + + API_RETURN_STRING(result); +} + +API_FUNC(completion_list_add) +{ + int nick_completion; + + API_INIT_FUNC(1, "completion_list_add", "ssis", API_RETURN_ERROR); + + v8::String::Utf8Value completion(args[0]); + v8::String::Utf8Value word(args[1]); + nick_completion = args[2]->IntegerValue(); + v8::String::Utf8Value where(args[3]); + + weechat_completion_list_add ( + (struct t_gui_completion *)API_STR2PTR(*completion), + *word, + nick_completion, + *where); + + API_RETURN_OK; +} + API_FUNC(completion_free) { API_INIT_FUNC(1, "completion_free", "s", API_RETURN_ERROR); @@ -5038,6 +5084,8 @@ WeechatJsV8::loadLibs() API_DEF_FUNC(command_options); API_DEF_FUNC(completion_new); API_DEF_FUNC(completion_search); + API_DEF_FUNC(completion_get_string); + API_DEF_FUNC(completion_list_add); API_DEF_FUNC(completion_free); API_DEF_FUNC(info_get); API_DEF_FUNC(info_get_hashtable); |