commit 69e7253
grunfink
·
2026-04-10 06:52:28 +0000 UTC
parent 9f5abf2
Add following and followers (if available) in people entries.
1 files changed,
+14,
-0
M
html.c
M
html.c
+14,
-0
1@@ -3794,6 +3794,20 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
2 xs_html_add(snac_post, snac_content);
3 }
4
5+ /* does it have account metrics in the object? */
6+ const xs_val *fwing = xs_dict_get(actor, "following_count");
7+ const xs_val *fwers = xs_dict_get(actor, "followers_count");
8+
9+ if (!xs_is_null(fwing) && !xs_is_null(fwers)) {
10+ xs *s = xs_fmt(L("%d following, %d followers"),
11+ (int) xs_number_get_l(fwing), (int) xs_number_get_l(fwers));
12+
13+ xs_html_add(snac_post,
14+ xs_html_tag("div",
15+ xs_html_tag("p",
16+ xs_html_text(s))));
17+ }
18+
19 /* add user metadata */
20 xs_html *snac_metadata = xs_html_tag("div",
21 xs_html_attr("class", "snac-metadata"));