void
rspamd_symcache_get_symbol_details(struct rspamd_symcache *cache,
const gchar *symbol,
- const ucl_object_t *this_sym_ucl)
+ ucl_object_t *this_sym_ucl)
{
struct rspamd_symcache_item *item;
msg_debug_cache_task ("enable profiling of symbols for task");
checkpoint->profile = TRUE;
}
-}
\ No newline at end of file
+}
}
lua_pop (L, 1);
if (group) {
- if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED)
- {
+ if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED) {
/* Unset the "ungrouped" group */
sym->gr = NULL;
}
- /* Add the group */
+ /* Add the group. If the symbol was ungrouped, this will
+ * clear RSPAMD_SYMBOL_FLAG_UNGROUPPED from the flags. */
rspamd_config_add_symbol_group (cfg, name, group);
}
}
ucl_object_fromdouble (s->score),
"score", strlen ("score"),
false);
+
ucl_object_insert_key (this_sym_ucl,
ucl_object_fromstring (s->description),
"description", strlen ("description"), false);
ucl_object_t *add_groups = ucl_object_typed_new (UCL_ARRAY);
guint j;
struct rspamd_symbols_group *add_gr;
- bool one_extra = false;
+ bool has_extra_groups = false;
PTR_ARRAY_FOREACH (s->groups, j, add_gr) {
if (add_gr->name && strcmp (add_gr->name, gr_name) != 0) {
ucl_array_append (add_groups,
ucl_object_fromstring (add_gr->name));
- one_extra = true;
+ has_extra_groups = true;
}
}
- if (one_extra == true) {
+ if (has_extra_groups == true) {
ucl_object_insert_key (this_sym_ucl,
add_groups,
"groups", strlen ("groups"),