aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-05 19:29:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-05 19:34:36 +0100
commite809039a9e84cb6235a6447d1c9c8fc34ddcf8c6 (patch)
treec5435d9d86da70b40e10ab4502e972c86410cb52
parent745bc065bb4ad94296bb61c2d1338fb9f433025f (diff)
downloadrspamd-e809039a9e84cb6235a6447d1c9c8fc34ddcf8c6.tar.gz
rspamd-e809039a9e84cb6235a6447d1c9c8fc34ddcf8c6.zip
[Fix] Remove incorrect method `task:set_metric_subject`
-rw-r--r--src/libserver/cfg_file.h2
-rw-r--r--src/lua/lua_task.c28
2 files changed, 1 insertions, 29 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index d96c6e474..48f352f49 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -269,7 +269,7 @@ struct rspamd_metric {
gdouble unknown_weight; /**< weight of unknown symbols */
gdouble grow_factor; /**< grow factor for metric */
GHashTable *symbols; /**< weights of symbols in metric */
- gchar *subject; /**< subject rewrite string */
+ const gchar *subject; /**< subject rewrite string */
GHashTable * groups; /**< groups of symbols */
struct metric_action actions[METRIC_ACTION_MAX]; /**< all actions of the metric */
};
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 9d139044f..2f5883563 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -586,12 +586,6 @@ LUA_FUNCTION_DEF (task, set_metric_score);
* @param {string} action name to set
*/
LUA_FUNCTION_DEF (task, set_metric_action);
-/***
- * @method task:set_metric_subject(subject)
- * Set the subject in the default metric
- * @param {string} subject subject to set
- */
-LUA_FUNCTION_DEF (task, set_metric_subject);
/***
* @method task:learn(is_spam[, classifier)
@@ -886,7 +880,6 @@ static const struct luaL_reg tasklib_m[] = {
LUA_INTERFACE_DEF (task, get_metric_action),
LUA_INTERFACE_DEF (task, set_metric_score),
LUA_INTERFACE_DEF (task, set_metric_action),
- LUA_INTERFACE_DEF (task, set_metric_subject),
LUA_INTERFACE_DEF (task, learn),
LUA_INTERFACE_DEF (task, set_settings),
LUA_INTERFACE_DEF (task, get_settings),
@@ -4076,27 +4069,6 @@ lua_task_set_metric_action (lua_State *L)
}
static gint
-lua_task_set_metric_subject (lua_State *L)
-{
- struct rspamd_task *task = lua_check_task (L, 1);
- const gchar *subject;
- struct rspamd_metric *metric;
-
- metric = task->cfg->default_metric;
- subject = luaL_checkstring (L, 2);
-
- if (task && metric && subject) {
- metric->subject = rspamd_mempool_strdup (task->task_pool, subject);
- lua_pushboolean (L, true);
- }
- else {
- return luaL_error (L, "invalid arguments");
- }
-
- return 1;
-}
-
-static gint
lua_task_get_protocol_reply (lua_State *L)
{
struct rspamd_task *task = lua_check_task (L, 1);