diff options
| author | 2023-04-13 17:34:48 +0200 | |
|---|---|---|
| committer | 2023-04-13 17:34:48 +0200 | |
| commit | 1a27e67ed9e4c4b12d9ee4d151c7647043b54647 (patch) | |
| tree | ee59fbe612da767a7f21db117d41b711b7a763ad /mastoapi.c | |
| parent | New function notify_check_time(). (diff) | |
| download | snac2-1a27e67ed9e4c4b12d9ee4d151c7647043b54647.tar.gz snac2-1a27e67ed9e4c4b12d9ee4d151c7647043b54647.tar.xz snac2-1a27e67ed9e4c4b12d9ee4d151c7647043b54647.zip | |
New functions notify_get() and notify_list().
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 12 |
1 files changed, 9 insertions, 3 deletions
| @@ -855,9 +855,15 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 855 | else | 855 | else |
| 856 | if (strcmp(cmd, "/notifications") == 0) { | 856 | if (strcmp(cmd, "/notifications") == 0) { |
| 857 | /* TBD */ | 857 | /* TBD */ |
| 858 | *body = xs_dup("[]"); | 858 | if (logged_in) { |
| 859 | *ctype = "application/json"; | 859 | xs *l = notify_list(&snac1, 0); |
| 860 | status = 200; | 860 | |
| 861 | *body = xs_dup("[]"); | ||
| 862 | *ctype = "application/json"; | ||
| 863 | status = 200; | ||
| 864 | } | ||
| 865 | else | ||
| 866 | status = 401; | ||
| 861 | } | 867 | } |
| 862 | else | 868 | else |
| 863 | if (strcmp(cmd, "/filters") == 0) { | 869 | if (strcmp(cmd, "/filters") == 0) { |