snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit fa3904c5a7a4b4f75446b30b107467ae5f1ed6ee
parent 39a9afb7c2151d84cef4da96f0d9f72f442662c6
Author: default <nobody@localhost>
Date:   Wed, 23 Nov 2022 16:59:35 +0100

New function object_del().

Diffstat:
Mdata.c | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/data.c b/data.c @@ -273,6 +273,21 @@ int object_add(const char *id, d_char *obj) } +int object_del(const char *id) +/* deletes an object */ +{ + int status = 404; + xs *fn = _object_fn_by_id(id); + + if (fn != NULL && unlink(fn) != -1) + status = 200; + + srv_debug(2, xs_fmt("object_del %s %d", id, status)); + + return status; +} + + d_char *_follower_fn(snac *snac, char *actor) { xs *md5 = xs_md5_hex(actor, strlen(actor));