commit d8eaa95
grunfink
·
2026-04-11 06:59:12 +0000 UTC
parent 8249301
Even if follow metrics are available in the actor object, don't show if both are 0.
1 files changed,
+10,
-6
M
html.c
M
html.c
+10,
-6
1@@ -3810,13 +3810,17 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
2 const xs_val *fwers = xs_dict_get(actor, "followers_count");
3
4 if (!xs_is_null(fwing) && !xs_is_null(fwers)) {
5- xs *s = xs_fmt(L("%d following, %d followers"),
6- (int) xs_number_get_l(fwing), (int) xs_number_get_l(fwers));
7+ int i_fwing = (int) xs_number_get_l(fwing);
8+ int i_fwers = (int) xs_number_get_l(fwers);
9
10- xs_html_add(snac_post,
11- xs_html_tag("div",
12- xs_html_tag("p",
13- xs_html_text(s))));
14+ if (i_fwing || i_fwers) {
15+ xs *s = xs_fmt(L("%d following, %d followers"), i_fwing, i_fwers);
16+
17+ xs_html_add(snac_post,
18+ xs_html_tag("div",
19+ xs_html_tag("p",
20+ xs_html_text(s))));
21+ }
22 }
23
24 /* add user metadata */