commit 19cf072
grunfink
·
2026-04-10 07:07:03 +0000 UTC
parent 69e7253
If wanted so, add "following_count" and "followers_count" in the Person object.
1 files changed,
+8,
-0
+8,
-0
1@@ -1932,6 +1932,14 @@ xs_dict *msg_actor(snac *snac)
2 xs *webfinger = xs_fmt("%s@%s", snac->uid, xs_dict_get(srv_config, "host"));
3 msg = xs_dict_set(msg, "webfinger", webfinger);
4
5+ if (xs_is_true(xs_dict_get(snac->config, "show_contact_metrics"))) {
6+ xs *fwing = xs_number_new_l(following_list_len(snac));
7+ xs *fwers = xs_number_new_l(follower_list_len(snac));
8+
9+ msg = xs_dict_set(msg, "following_count", fwing);
10+ msg = xs_dict_set(msg, "followers_count", fwers);
11+ }
12+
13 /* cache it */
14 snac_debug(snac, 1, xs_fmt("Caching actor %s", snac->actor));
15 object_add_ow(snac->actor, msg);