summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-14 19:39:31 +0200
committerdefault <nobody@localhost>2023-04-14 19:39:31 +0200
commit9e7a77c10f0bf3e4d9c99ff8c188476ca9c62a92 (patch)
tree80ec39655d24a8a175852de671ff300f238c52a4 /mastoapi.c
parent58b2a47631363e9d35d8194694483b53ed06b03c (diff)
New mastoapi to clear all notifications.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index f9141d0..d07d012 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1290,6 +1290,19 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
else
status = 401;
}
+ else
+ if (strcmp(cmd, "/notifications/clear") == 0) {
+ if (logged_in) {
+ notify_clear(&snac);
+ timeline_touch(&snac);
+
+ *body = xs_dup("{}");
+ *ctype = "application/json";
+ status = 200;
+ }
+ else
+ status = 401;
+ }
/* user cleanup */
if (logged_in)