commit fa3904c

default  ·  2022-11-23 15:59:35 +0000 UTC
parent 39a9afb
New function object_del().
1 files changed,  +15, -0
M data.c
M data.c
+15, -0
 1@@ -273,6 +273,21 @@ int object_add(const char *id, d_char *obj)
 2 }
 3 
 4 
 5+int object_del(const char *id)
 6+/* deletes an object */
 7+{
 8+    int status = 404;
 9+    xs *fn     = _object_fn_by_id(id);
10+
11+    if (fn != NULL && unlink(fn) != -1)
12+        status = 200;
13+
14+    srv_debug(2, xs_fmt("object_del %s %d", id, status));
15+
16+    return status;
17+}
18+
19+
20 d_char *_follower_fn(snac *snac, char *actor)
21 {
22     xs *md5 = xs_md5_hex(actor, strlen(actor));