From a15e3d27f41d18d917f93c25a1f475f09ad14e41 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 24 Jul 2022 20:37:15 +0100 Subject: [PATCH] [Minor] Restore Lua API --- src/lua/lua_config.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 06a22f096..0ab834054 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 -- 2.39.5