diff options
author | default <nobody@localhost> | 2022-10-01 19:37:47 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-10-01 19:37:47 +0200 |
commit | 82e9a03925d27d9228ac5a20445b02902a70d0ca (patch) | |
tree | 61fc680d00bfbfa02fdc77d7a85030187187323f /html.c | |
parent | 450c0e7aad09491b2abd177e695d3080c352af5e (diff) |
Implemented 'Delete'.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -930,6 +930,19 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, } else if (strcmp(action, L("Delete")) == 0) { + /* delete an entry */ + if (xs_startswith(id, snac.actor)) { + /* it's a post by us: generate a delete */ + xs *msg = msg_delete(&snac, id); + + post(&snac, msg); + + snac_log(&snac, xs_fmt("posted tombstone for %s", id)); + } + + timeline_del(&snac, id); + + snac_log(&snac, xs_fmt("deleted entry %s", id)); } else status = 404; |