]> source.dussan.org Git - rspamd.git/commitdiff
Weight is an alias for scores symbols.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Aug 2015 14:32:12 +0000 (15:32 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Aug 2015 14:32:12 +0000 (15:32 +0100)
src/libserver/cfg_rcl.c

index def4ac4b3dcb9521869b29ecbbeb96dbd8832ce8..94817d8c683c2aab8de9d288a9d39248c37045c8 100644 (file)
@@ -352,7 +352,7 @@ rspamd_rcl_symbol_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
                return FALSE;
        }
 
-       if (ucl_object_find_key (obj, "score") != NULL) {
+       if (ucl_object_find_any_key (obj, "score", "weight", NULL) != NULL) {
                *sym_def->weight_ptr = sym_def->score;
        }
 
@@ -1417,6 +1417,11 @@ rspamd_rcl_config_init (void)
                        rspamd_rcl_parse_struct_double,
                        G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
                        0);
+       rspamd_rcl_add_default_handler (ssub,
+                       "weight",
+                       rspamd_rcl_parse_struct_double,
+                       G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
+                       0);
 
        /* Actions part */
        ssub = rspamd_rcl_add_section (&sub->subsections,
@@ -1471,6 +1476,11 @@ rspamd_rcl_config_init (void)
                        rspamd_rcl_parse_struct_double,
                        G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
                        0);
+       rspamd_rcl_add_default_handler (sssub,
+                       "weight",
+                       rspamd_rcl_parse_struct_double,
+                       G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
+                       0);
 
        /**
         * Worker section