summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-11 10:54:56 +0200
committerdefault <nobody@localhost>2023-05-11 10:54:56 +0200
commit6d82dde0c5225afd0983a8cb12438bd21c21369f (patch)
tree673ae037309eb6f1ab8d317fca83e1842b95e137
parent9c4e491497d42770d64e9770fe347514f577cf39 (diff)
Added support from exclude notification types.
-rw-r--r--mastoapi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 876e63c..c738841 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1158,6 +1158,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
xs *out = xs_list_new();
xs_list *p = l;
xs_dict *v;
+ xs_list *excl = xs_dict_get(args, "exclude_types[]");
while (xs_list_iter(&p, &v)) {
xs *noti = notify_get(&snac1, v);
@@ -1194,6 +1195,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
else
continue;
+ /* excluded type? */
+ if (!xs_is_null(excl) && xs_list_in(excl, type) != -1)
+ continue;
+
xs *mn = xs_dict_new();
mn = xs_dict_append(mn, "type", type);