1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 14:43:11 +02:00

Add spamfilter::rule (preconditions), add context to crule parser,

and add the first functions: online_time() and reputation().

The more interesting stuff will follow later...
This commit is contained in:
Bram Matthys
2023-07-06 15:43:12 +02:00
parent 1e572e25b9
commit 6bbcdfd1b3
11 changed files with 226 additions and 109 deletions
+7 -2
View File
@@ -569,8 +569,13 @@ void json_expand_tkl(json_t *root, const char *key, TKL *tkl, int detail)
} else
if (TKLIsSpamfilter(tkl))
{
json_object_set_new(j, "name", json_string_unreal(tkl->ptr.spamfilter->match->str));
json_object_set_new(j, "match_type", json_string_unreal(unreal_match_method_valtostr(tkl->ptr.spamfilter->match->type)));
if (tkl->ptr.spamfilter->match->str)
{
json_object_set_new(j, "name", json_string_unreal(tkl->ptr.spamfilter->match->str));
json_object_set_new(j, "match_type", json_string_unreal(unreal_match_method_valtostr(tkl->ptr.spamfilter->match->type)));
}
if (tkl->ptr.spamfilter->prettyrule)
json_object_set_new(j, "rule", json_string_unreal(tkl->ptr.spamfilter->prettyrule));
json_object_set_new(j, "ban_action", json_string_unreal(ban_actions_to_string(tkl->ptr.spamfilter->action)));
json_object_set_new(j, "ban_duration", json_integer(tkl->ptr.spamfilter->tkl_duration));
json_object_set_new(j, "ban_duration_string", json_string_unreal(pretty_time_val_r(buf, sizeof(buf), tkl->ptr.spamfilter->tkl_duration)));