diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-24 17:54:30 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-24 17:54:30 +0000 |
commit | f4e9928ae179eafc13ee564682e9946a24691b7d (patch) | |
tree | 180225e1ccc762464892f2cf429c2dfc5770ddd0 /src/libserver/cfg_file.h | |
parent | 6c6de2946b70a4f460533ded4233013a0b1b1557 (diff) | |
download | rspamd-f4e9928ae179eafc13ee564682e9946a24691b7d.tar.gz rspamd-f4e9928ae179eafc13ee564682e9946a24691b7d.zip |
Rework system of symbols registration
It is possible now to use priorities when adding symbols to metrics and
override scores for symbols with lower priority with the scores with
high priority.
Diffstat (limited to 'src/libserver/cfg_file.h')
-rw-r--r-- | src/libserver/cfg_file.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 373daf744..88b5b4538 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -101,6 +101,7 @@ struct rspamd_symbol_def { gchar *description; gdouble *weight_ptr; gdouble score; + guint priority; struct rspamd_symbols_group *gr; GList *groups; guint flags; @@ -494,6 +495,7 @@ gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig); /** * Add new symbol to the metric + * @param cfg * @param metric metric's name (or NULL for the default metric) * @param symbol symbol's name * @param score symbol's score @@ -501,12 +503,14 @@ gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig); * @param group optional group name * @param one_shot TRUE if symbol can add its score once * @param rewrite_existing TRUE if we need to rewrite the existing symbol + * @param priority use the following priority for a symbol * @return TRUE if symbol has been inserted or FALSE if `rewrite_existing` is not enabled and symbol already exists */ gboolean rspamd_config_add_metric_symbol (struct rspamd_config *cfg, const gchar *metric, const gchar *symbol, gdouble score, const gchar *description, - const gchar *group, gboolean one_shot, gboolean rewrite_existing); + const gchar *group, guint flags, + guint priority); /** * Checks if a specified C or lua module is enabled or disabled in the config. |