diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-27 15:02:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-27 15:02:20 +0100 |
commit | 1b152c5db87f6bc306e51a24b5024d0083f9b1bb (patch) | |
tree | df603d47ab1df7d87c1de112d91da5cc87c2f6bd /src/lua | |
parent | 874af6856f4362ab6077b37a5defa8f3aa13d395 (diff) | |
download | rspamd-1b152c5db87f6bc306e51a24b5024d0083f9b1bb.tar.gz rspamd-1b152c5db87f6bc306e51a24b5024d0083f9b1bb.zip |
[Feature] Correctly work when there is no hard reject action
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_task.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index e11c3e5c1..a47516203 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -3009,6 +3009,7 @@ lua_task_get_metric_score (lua_State *L) { struct rspamd_task *task = lua_check_task (L, 1); const gchar *metric_name; + gdouble rs; struct metric_result *metric_res; metric_name = luaL_checkstring (L, 2); @@ -3018,12 +3019,11 @@ lua_task_get_metric_score (lua_State *L) g_hash_table_lookup (task->results, metric_name)) != NULL) { lua_newtable (L); lua_pushnumber (L, metric_res->score); + rs = rspamd_task_get_required_score (task, metric_res); lua_rawseti (L, -2, 1); - lua_pushnumber (L, - metric_res->metric->actions[METRIC_ACTION_REJECT].score); + lua_pushnumber (L, rs); lua_rawseti (L, -2, 2); - lua_pushnumber (L, - metric_res->metric->actions[METRIC_ACTION_REJECT].score); + lua_pushnumber (L, rs); lua_rawseti (L, -2, 3); } else { |