summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar default2023-05-11 10:54:56 +0200
committerGravatar default2023-05-11 10:54:56 +0200
commit6d82dde0c5225afd0983a8cb12438bd21c21369f (patch)
tree673ae037309eb6f1ab8d317fca83e1842b95e137 /mastoapi.c
parentBackport from xs. (diff)
downloadsnac2-6d82dde0c5225afd0983a8cb12438bd21c21369f.tar.gz
snac2-6d82dde0c5225afd0983a8cb12438bd21c21369f.tar.xz
snac2-6d82dde0c5225afd0983a8cb12438bd21c21369f.zip
Added support from exclude notification types.
Diffstat (limited to 'mastoapi.c')
-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,
1158 xs *out = xs_list_new(); 1158 xs *out = xs_list_new();
1159 xs_list *p = l; 1159 xs_list *p = l;
1160 xs_dict *v; 1160 xs_dict *v;
1161 xs_list *excl = xs_dict_get(args, "exclude_types[]");
1161 1162
1162 while (xs_list_iter(&p, &v)) { 1163 while (xs_list_iter(&p, &v)) {
1163 xs *noti = notify_get(&snac1, v); 1164 xs *noti = notify_get(&snac1, v);
@@ -1194,6 +1195,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1194 else 1195 else
1195 continue; 1196 continue;
1196 1197
1198 /* excluded type? */
1199 if (!xs_is_null(excl) && xs_list_in(excl, type) != -1)
1200 continue;
1201
1197 xs *mn = xs_dict_new(); 1202 xs *mn = xs_dict_new();
1198 1203
1199 mn = xs_dict_append(mn, "type", type); 1204 mn = xs_dict_append(mn, "type", type);