summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2022-11-24 09:58:37 +0100
committerGravatar default2022-11-24 09:58:37 +0100
commite121aeb948280d3c519d2ae276dc71df88b90e4d (patch)
treea5bf6e41b63dec3d5c8d882e1caf2be3db33a489 /data.c
parentUse the new hide API. (diff)
downloadsnac2-e121aeb948280d3c519d2ae276dc71df88b90e4d.tar.gz
snac2-e121aeb948280d3c519d2ae276dc71df88b90e4d.tar.xz
snac2-e121aeb948280d3c519d2ae276dc71df88b90e4d.zip
New function object_children().
Diffstat (limited to 'data.c')
-rw-r--r--data.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/data.c b/data.c
index a04dac1..525b1e9 100644
--- a/data.c
+++ b/data.c
@@ -452,6 +452,17 @@ int object_del(const char *id)
452} 452}
453 453
454 454
455d_char *object_children(const char *id)
456/* returns the list of an object's children */
457{
458 xs *fn = _object_fn(id);
459
460 fn = xs_replace_i(fn, ".json", "_c.idx");
461
462 return index_list(fn, XS_ALL);
463}
464
465
455d_char *_follower_fn(snac *snac, char *actor) 466d_char *_follower_fn(snac *snac, char *actor)
456{ 467{
457 xs *md5 = xs_md5_hex(actor, strlen(actor)); 468 xs *md5 = xs_md5_hex(actor, strlen(actor));
@@ -1080,6 +1091,14 @@ void hide(snac *snac, const char *id)
1080 fclose(f); 1091 fclose(f);
1081 1092
1082 snac_debug(snac, 2, xs_fmt("hidden %s %s", id, fn)); 1093 snac_debug(snac, 2, xs_fmt("hidden %s %s", id, fn));
1094
1095 /* hide all the children */
1096 xs *chld = object_children(id);
1097 char *p, *v;
1098
1099 p = chld;
1100 while (xs_list_iter(&p, &v))
1101 hide(snac, v);
1083 } 1102 }
1084} 1103}
1085 1104