diff options
| author | grunfink <grunfink@noreply.codeberg.org> | 2025-05-20 06:32:39 +0200 |
|---|---|---|
| committer | grunfink <grunfink@noreply.codeberg.org> | 2025-05-20 06:32:39 +0200 |
| commit | aa49cf4222e24535b577649add66be8f90cca17f (patch) | |
| tree | 96e63bc2a4e2a4e1869c5b84bbafe7d434d2f435 /data.c | |
| parent | c950981cca0896558ffae7e66b76f43f1ec49969 (diff) | |
| parent | 321f64ed70d039dea510c8a7d7aee7dc9577737a (diff) | |
Merge pull request 'Faster performance metrics' (#395) from dandelions/snac2:pr-faster-metric into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/395
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1215,6 +1215,14 @@ int follower_check(snac *snac, const char *actor) } +int follower_list_len(snac *snac) +/* returns the number of followers */ +{ + xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0); + return xs_list_len(list); +} + + xs_list *follower_list(snac *snac) /* returns the list of followers */ { @@ -1709,6 +1717,15 @@ int following_get(snac *snac, const char *actor, xs_dict **data) } +int following_list_len(snac *snac) +/* returns number of people being followed */ +{ + xs *spec = xs_fmt("%s/following/" "*_a.json", snac->basedir); + xs *glist = xs_glob(spec, 0, 0); + return xs_list_len(glist); +} + + xs_list *following_list(snac *snac) /* returns the list of people being followed */ { |