From 30407f99301e57794fe71addf9cb093cb72c3ddd Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 13 Oct 2021 11:18:51 +0300 Subject: [PATCH] lua/api: add bindings for client:send_error() --- modules/module-lua-scripting/api.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/module-lua-scripting/api.c b/modules/module-lua-scripting/api.c index 28304779..11762f3a 100644 --- a/modules/module-lua-scripting/api.c +++ b/modules/module-lua-scripting/api.c @@ -1117,8 +1117,20 @@ client_update_permissions (lua_State *L) return 0; } +static int +client_send_error (lua_State *L) +{ + WpClient *client = wplua_checkobject (L, 1, WP_TYPE_CLIENT); + guint id = luaL_checkinteger (L, 2); + int res = luaL_checkinteger (L, 3); + const char *message = luaL_checkstring (L, 4); + wp_client_send_error (client, id, res, message); + return 0; +} + static const luaL_Reg client_methods[] = { { "update_permissions", client_update_permissions }, + { "send_error", client_send_error }, { NULL, NULL } };