commit 6d82dde

default  ·  2023-05-11 08:54:56 +0000 UTC
parent 9c4e491
Added support from exclude notification types.
1 files changed,  +5, -0
+5, -0
 1@@ -1158,6 +1158,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
 2             xs *out    = xs_list_new();
 3             xs_list *p = l;
 4             xs_dict *v;
 5+            xs_list *excl = xs_dict_get(args, "exclude_types[]");
 6 
 7             while (xs_list_iter(&p, &v)) {
 8                 xs *noti = notify_get(&snac1, v);
 9@@ -1194,6 +1195,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
10                 else
11                     continue;
12 
13+                /* excluded type? */
14+                if (!xs_is_null(excl) && xs_list_in(excl, type) != -1)
15+                    continue;
16+
17                 xs *mn = xs_dict_new();
18 
19                 mn = xs_dict_append(mn, "type", type);