aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-04-10 08:52:28 +0200
committergrunfink <grunfink@comam.es>2026-04-10 08:52:28 +0200
commit69e72536b8c8e2a79125c1fa92ab4a2d191715f8 (patch)
tree7eed4d53bc0cb14c16a22107b4d8bb996e9d7fc3
parent9f5abf2bdd7b3c9a56a5b792e54523c4361789ad (diff)
Add following and followers (if available) in people entries.
-rw-r--r--html.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/html.c b/html.c
index 122bfee..c503702 100644
--- a/html.c
+++ b/html.c
@@ -3794,6 +3794,20 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
xs_html_add(snac_post, snac_content);
}
+ /* does it have account metrics in the object? */
+ const xs_val *fwing = xs_dict_get(actor, "following_count");
+ const xs_val *fwers = xs_dict_get(actor, "followers_count");
+
+ if (!xs_is_null(fwing) && !xs_is_null(fwers)) {
+ xs *s = xs_fmt(L("%d following, %d followers"),
+ (int) xs_number_get_l(fwing), (int) xs_number_get_l(fwers));
+
+ xs_html_add(snac_post,
+ xs_html_tag("div",
+ xs_html_tag("p",
+ xs_html_text(s))));
+ }
+
/* add user metadata */
xs_html *snac_metadata = xs_html_tag("div",
xs_html_attr("class", "snac-metadata"));