summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar Louis Brauer2024-05-27 12:24:17 +0200
committerGravatar Louis Brauer2024-05-27 12:24:17 +0200
commit81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5 (patch)
tree10528a18c859964fa11eabe15955c85dce7ecf25 /html.c
parentUse enum instead of numeric status codes for HTTP statuses (diff)
downloadpenes-snac2-81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5.tar.gz
penes-snac2-81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5.tar.xz
penes-snac2-81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5.zip
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,
3334 snac.config = xs_dict_set(snac.config, "passwd", pw); 3334 snac.config = xs_dict_set(snac.config, "passwd", pw);
3335 } 3335 }
3336 3336
3337 xs *fn = xs_fmt("%s/user.json", snac.basedir); 3337 user_persist(&snac);
3338 xs *bfn = xs_fmt("%s.bak", fn);
3339 FILE *f;
3340
3341 rename(fn, bfn);
3342
3343 if ((f = fopen(fn, "w")) != NULL) {
3344 xs_json_dump(snac.config, 4, f);
3345 fclose(f);
3346 }
3347 else
3348 rename(bfn, fn);
3349
3350 history_del(&snac, "timeline.html_");
3351
3352 xs *a_msg = msg_actor(&snac);
3353 xs *u_msg = msg_update(&snac, a_msg);
3354
3355 enqueue_message(&snac, u_msg);
3356
3357 enqueue_verify_links(&snac);
3358 3338
3359 status = HTTP_STATUS_SEE_OTHER; 3339 status = HTTP_STATUS_SEE_OTHER;
3360 } 3340 }