Added support from exclude notification types.

This commit is contained in:
default 2023-05-11 10:54:56 +02:00
parent 9c4e491497
commit 6d82dde0c5

View file

@ -1158,6 +1158,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
xs *out = xs_list_new(); xs *out = xs_list_new();
xs_list *p = l; xs_list *p = l;
xs_dict *v; xs_dict *v;
xs_list *excl = xs_dict_get(args, "exclude_types[]");
while (xs_list_iter(&p, &v)) { while (xs_list_iter(&p, &v)) {
xs *noti = notify_get(&snac1, v); xs *noti = notify_get(&snac1, v);
@ -1194,6 +1195,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
else else
continue; continue;
/* excluded type? */
if (!xs_is_null(excl) && xs_list_in(excl, type) != -1)
continue;
xs *mn = xs_dict_new(); xs *mn = xs_dict_new();
mn = xs_dict_append(mn, "type", type); mn = xs_dict_append(mn, "type", type);