lua/api: add bindings for client:send_error()

This commit is contained in:
George Kiagiadakis
2021-10-13 11:18:51 +03:00
parent 5ce2dd3e66
commit 30407f9930

View File

@@ -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 }
};