diff options
| author | 2023-04-14 19:39:31 +0200 | |
|---|---|---|
| committer | 2023-04-14 19:39:31 +0200 | |
| commit | 9e7a77c10f0bf3e4d9c99ff8c188476ca9c62a92 (patch) | |
| tree | 80ec39655d24a8a175852de671ff300f238c52a4 /mastoapi.c | |
| parent | Set the timeline check time after showing the notifications. (diff) | |
| download | snac2-9e7a77c10f0bf3e4d9c99ff8c188476ca9c62a92.tar.gz snac2-9e7a77c10f0bf3e4d9c99ff8c188476ca9c62a92.tar.xz snac2-9e7a77c10f0bf3e4d9c99ff8c188476ca9c62a92.zip | |
New mastoapi to clear all notifications.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -1290,6 +1290,19 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1290 | else | 1290 | else |
| 1291 | status = 401; | 1291 | status = 401; |
| 1292 | } | 1292 | } |
| 1293 | else | ||
| 1294 | if (strcmp(cmd, "/notifications/clear") == 0) { | ||
| 1295 | if (logged_in) { | ||
| 1296 | notify_clear(&snac); | ||
| 1297 | timeline_touch(&snac); | ||
| 1298 | |||
| 1299 | *body = xs_dup("{}"); | ||
| 1300 | *ctype = "application/json"; | ||
| 1301 | status = 200; | ||
| 1302 | } | ||
| 1303 | else | ||
| 1304 | status = 401; | ||
| 1305 | } | ||
| 1293 | 1306 | ||
| 1294 | /* user cleanup */ | 1307 | /* user cleanup */ |
| 1295 | if (logged_in) | 1308 | if (logged_in) |