diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-01 19:03:05 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-01 19:03:05 +0200 |
commit | ff83985ef4f4073f9430ee065b1d8982fb7c6318 (patch) | |
tree | 2b94f2cd1e36de9bb54a02153e1d30be8145bc21 /src/plugins/scripts/lua | |
parent | 51af351c15c0277d0c6f060624b67b04e77710df (diff) | |
download | weechat-ff83985ef4f4073f9430ee065b1d8982fb7c6318.zip |
Add default template completion (by default: nick or IRC channel)
Diffstat (limited to 'src/plugins/scripts/lua')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 7808cdc74..e2d510acf 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -550,7 +550,7 @@ weechat_lua_api_list_new (lua_State *L) static int weechat_lua_api_list_add (lua_State *L) { - const char *weelist, *data, *where; + const char *weelist, *data, *where, *user_data; char *result; int n; @@ -566,22 +566,25 @@ weechat_lua_api_list_add (lua_State *L) weelist = NULL; data = NULL; where = NULL; + user_data = NULL; n = lua_gettop (lua_current_interpreter); - if (n < 3) + if (n < 4) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add"); LUA_RETURN_EMPTY; } - weelist = lua_tostring (lua_current_interpreter, -3); - data = lua_tostring (lua_current_interpreter, -2); - where = lua_tostring (lua_current_interpreter, -1); + weelist = lua_tostring (lua_current_interpreter, -4); + data = lua_tostring (lua_current_interpreter, -3); + where = lua_tostring (lua_current_interpreter, -2); + user_data = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (weechat_list_add (script_str2ptr (weelist), data, - where)); + where, + script_str2ptr (user_data))); LUA_RETURN_STRING_FREE(result); } |