From: Vsevolod Stakhov Date: Sun, 24 Jul 2022 19:37:15 +0000 (+0100) Subject: [Minor] Restore Lua API X-Git-Tag: 3.3~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a15e3d27f41d18d917f93c25a1f475f09ad14e41;p=thirdparty%2Frspamd.git [Minor] Restore Lua API --- diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 06a22f0968..0ab8340548 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -2913,13 +2913,31 @@ lua_config_set_peak_cb (lua_State *L) static gint lua_config_enable_symbol (lua_State *L) { - return luaL_error (L, "obsoleted method"); + struct rspamd_config *cfg = lua_check_config (L, 1); + const char *sym = luaL_checkstring (L, 2); + + if (!sym || !cfg) { + return luaL_error (L, "invalid arguments"); + } + + rspamd_symcache_enable_symbol_static(cfg->cache, sym); + + return 0; } static gint lua_config_disable_symbol (lua_State *L) { - return luaL_error (L, "obsoleted method"); + struct rspamd_config *cfg = lua_check_config (L, 1); + const char *sym = luaL_checkstring (L, 2); + + if (!sym || !cfg) { + return luaL_error (L, "invalid arguments"); + } + + rspamd_symcache_disable_symbol_static(cfg->cache, sym); + + return 0; } static gint