From: Vsevolod Stakhov Date: Sun, 8 Oct 2017 10:07:43 +0000 (+0100) Subject: [Minor] Adjust metric score when changing symbol's score X-Git-Tag: 1.7.0~574 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8de4f25c4a3f1337ff3c0efb7ef646bfc4104982;p=thirdparty%2Frspamd.git [Minor] Adjust metric score when changing symbol's score --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 12c320b0af..c4f4de3fef 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1263,7 +1263,6 @@ lua_task_adjust_result (lua_State * L) const gchar *symbol_name, *param; struct rspamd_metric_result *metric_res; struct rspamd_symbol_result *s = NULL; - struct rspamd_symbol_option *opt; double weight; gint i, top; @@ -1282,7 +1281,9 @@ lua_task_adjust_result (lua_State * L) } if (s) { + metric_res->score -= s->score; s->score = weight; + metric_res->score += s->score; } else { return luaL_error (L, "symbol not found: %s", symbol_name);