summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-01 19:37:47 +0200
committerdefault <nobody@localhost>2022-10-01 19:37:47 +0200
commit82e9a03925d27d9228ac5a20445b02902a70d0ca (patch)
tree61fc680d00bfbfa02fdc77d7a85030187187323f /html.c
parent450c0e7aad09491b2abd177e695d3080c352af5e (diff)
Implemented 'Delete'.
Diffstat (limited to 'html.c')
-rw-r--r--html.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/html.c b/html.c
index d6df61d..1e2248c 100644
--- a/html.c
+++ b/html.c
@@ -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;