Browse Source

Weight is an alias for scores symbols.

tags/1.0.0
Vsevolod Stakhov 8 years ago
parent
commit
0ef1d963c7
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      src/libserver/cfg_rcl.c

+ 11
- 1
src/libserver/cfg_rcl.c View 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

Loading…
Cancel
Save