summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorLouis Brauer <louis@openbooking.ch>2024-05-27 12:24:17 +0200
committerLouis Brauer <louis@openbooking.ch>2024-05-27 12:24:17 +0200
commit81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5 (patch)
tree10528a18c859964fa11eabe15955c85dce7ecf25 /html.c
parent0e21d35e802bf859aa14bce688cd9544458e9e9c (diff)
Implement Mastodon PATCH endpoint for account profile updates
Diffstat (limited to 'html.c')
-rw-r--r--html.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/html.c b/html.c
index 1840799..6267adf 100644
--- a/html.c
+++ b/html.c
@@ -3334,27 +3334,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
snac.config = xs_dict_set(snac.config, "passwd", pw);
}
- xs *fn = xs_fmt("%s/user.json", snac.basedir);
- xs *bfn = xs_fmt("%s.bak", fn);
- FILE *f;
-
- rename(fn, bfn);
-
- if ((f = fopen(fn, "w")) != NULL) {
- xs_json_dump(snac.config, 4, f);
- fclose(f);
- }
- else
- rename(bfn, fn);
-
- history_del(&snac, "timeline.html_");
-
- xs *a_msg = msg_actor(&snac);
- xs *u_msg = msg_update(&snac, a_msg);
-
- enqueue_message(&snac, u_msg);
-
- enqueue_verify_links(&snac);
+ user_persist(&snac);
status = HTTP_STATUS_SEE_OTHER;
}