aboutsummaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index cf2f53e..4139af1 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -4104,6 +4104,24 @@ int mastoapi_delete_handler(const xs_dict *req, const char *q_path,
else
status = HTTP_STATUS_UNAUTHORIZED;
}
+ else
+ if (xs_startswith(cmd, "/v1/profile/")) {
+ if (logged_in) {
+ xs *l = xs_split(cmd, "/");
+ const char *p = xs_list_get(l, -1);
+
+ if (strcmp(p, "avatar") == 0 || strcmp(p, "header") == 0) {
+ snac.config = xs_dict_set(snac.config, p, "");
+
+ if (user_persist(&snac, 1) == 0)
+ credentials_get(body, ctype, &status, snac);
+ else
+ status = HTTP_STATUS_INTERNAL_SERVER_ERROR;
+ }
+ }
+ else
+ status = HTTP_STATUS_UNAUTHORIZED;
+ }
/* user cleanup */
if (logged_in)