From f57c6e2c50e05aebbc9020fc9fe58b647b15b9dd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 15 May 2018 14:21:41 +0100 Subject: [Feature] Allow multiple groups for symbols --- src/libserver/cfg_file.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/libserver/cfg_file.h') diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 7a6cc1c8a..5a846a1f5 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -123,8 +123,8 @@ struct rspamd_symbol { gdouble *weight_ptr; gdouble score; guint priority; - struct rspamd_symbols_group *gr; - GList *groups; + struct rspamd_symbols_group *gr; /* Main group */ + GPtrArray *groups; /* Other groups */ guint flags; gint nshots; }; @@ -585,10 +585,24 @@ gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig); * @return TRUE if symbol has been inserted or FALSE if symbol already exists with higher priority */ gboolean rspamd_config_add_symbol (struct rspamd_config *cfg, - const gchar *symbol, gdouble score, const gchar *description, - const gchar *group, guint flags, - guint priority, - gint nshots); + const gchar *symbol, + gdouble score, + const gchar *description, + const gchar *group, + guint flags, + guint priority, + gint nshots); + +/** + * Adds new group for a symbol + * @param cfg + * @param symbol + * @param group + * @return + */ +gboolean rspamd_config_add_symbol_group (struct rspamd_config *cfg, + const gchar *symbol, + const gchar *group); /** * Sets action score for a specified metric with the specified priority -- cgit v1.2.3