mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-12 21:10:22 +03:00
New function object_children().
This commit is contained in:
parent
d215f8ce46
commit
e121aeb948
19
data.c
19
data.c
@ -452,6 +452,17 @@ int object_del(const char *id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
d_char *object_children(const char *id)
|
||||||
|
/* returns the list of an object's children */
|
||||||
|
{
|
||||||
|
xs *fn = _object_fn(id);
|
||||||
|
|
||||||
|
fn = xs_replace_i(fn, ".json", "_c.idx");
|
||||||
|
|
||||||
|
return index_list(fn, XS_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
d_char *_follower_fn(snac *snac, char *actor)
|
d_char *_follower_fn(snac *snac, char *actor)
|
||||||
{
|
{
|
||||||
xs *md5 = xs_md5_hex(actor, strlen(actor));
|
xs *md5 = xs_md5_hex(actor, strlen(actor));
|
||||||
@ -1080,6 +1091,14 @@ void hide(snac *snac, const char *id)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
snac_debug(snac, 2, xs_fmt("hidden %s %s", id, fn));
|
snac_debug(snac, 2, xs_fmt("hidden %s %s", id, fn));
|
||||||
|
|
||||||
|
/* hide all the children */
|
||||||
|
xs *chld = object_children(id);
|
||||||
|
char *p, *v;
|
||||||
|
|
||||||
|
p = chld;
|
||||||
|
while (xs_list_iter(&p, &v))
|
||||||
|
hide(snac, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user