aboutsummaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-04-10 09:07:03 +0200
committergrunfink <grunfink@comam.es>2026-04-10 09:07:03 +0200
commit19cf072f36cf01d781a39602def6514b7e033d42 (patch)
tree8d0e63c66325827a6ea544e494fed3d0716f6476 /activitypub.c
parent69e72536b8c8e2a79125c1fa92ab4a2d191715f8 (diff)
If wanted so, add "following_count" and "followers_count" in the Person object.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 277c1d0..2f6da8b 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1932,6 +1932,14 @@ xs_dict *msg_actor(snac *snac)
xs *webfinger = xs_fmt("%s@%s", snac->uid, xs_dict_get(srv_config, "host"));
msg = xs_dict_set(msg, "webfinger", webfinger);
+ if (xs_is_true(xs_dict_get(snac->config, "show_contact_metrics"))) {
+ xs *fwing = xs_number_new_l(following_list_len(snac));
+ xs *fwers = xs_number_new_l(follower_list_len(snac));
+
+ msg = xs_dict_set(msg, "following_count", fwing);
+ msg = xs_dict_set(msg, "followers_count", fwers);
+ }
+
/* cache it */
snac_debug(snac, 1, xs_fmt("Caching actor %s", snac->actor));
object_add_ow(snac->actor, msg);