From 1a27e67ed9e4c4b12d9ee4d151c7647043b54647 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 13 Apr 2023 17:34:48 +0200 Subject: New functions notify_get() and notify_list(). --- mastoapi.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index 7029dfb..fc636a9 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -855,9 +855,15 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, else if (strcmp(cmd, "/notifications") == 0) { /* TBD */ - *body = xs_dup("[]"); - *ctype = "application/json"; - status = 200; + if (logged_in) { + xs *l = notify_list(&snac1, 0); + + *body = xs_dup("[]"); + *ctype = "application/json"; + status = 200; + } + else + status = 401; } else if (strcmp(cmd, "/filters") == 0) { -- cgit v1.2.3