]> source.dussan.org Git - rspamd.git/commitdiff
Revert "[Fix] Remove incorrect method `task:set_metric_subject`"
authorAndrew Lewis <nerf@judo.za.org>
Thu, 7 Sep 2017 19:49:48 +0000 (21:49 +0200)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 9 Sep 2017 11:29:30 +0000 (12:29 +0100)
This reverts commit e809039a9e84cb6235a6447d1c9c8fc34ddcf8c6.

src/libserver/cfg_file.h
src/lua/lua_task.c

index c576401627287035541682cd4a8c4be9db317a50..45202f5ab92e96937f28a3ba8f8863f1fa6ff0e2 100644 (file)
@@ -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                                       */
-       const gchar *subject;                           /**< subject rewrite string                                                     */
+       gchar *subject;                                 /**< subject rewrite string                                                     */
        GHashTable * groups;                                /**< groups of symbols                                                              */
        struct metric_action actions[METRIC_ACTION_MAX]; /**< all actions of the metric                                         */
 };
index 5e1a6b9dbb7b8492fc9e0a776af4b0f75babedf0..b026be47eb0d9c5f527524763c489c083d066994 100644 (file)
@@ -561,6 +561,12 @@ 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)
@@ -852,6 +858,7 @@ 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),