aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-04-11 08:59:12 +0200
committergrunfink <grunfink@comam.es>2026-04-11 08:59:12 +0200
commitd8eaa95eb2dea542d93a98ce12b3ba36cd639a45 (patch)
tree3313559998aa433fbc607b50f751f8cbe3726f1d /html.c
parent82493015e54b10463594c913bd57c479a1e0bc2d (diff)
Even if follow metrics are available in the actor object, don't show if both are 0.
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/html.c b/html.c
index 148b8b2..07c6f7c 100644
--- a/html.c
+++ b/html.c
@@ -3810,13 +3810,17 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
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));
+ int i_fwing = (int) xs_number_get_l(fwing);
+ int i_fwers = (int) xs_number_get_l(fwers);
- xs_html_add(snac_post,
- xs_html_tag("div",
- xs_html_tag("p",
- xs_html_text(s))));
+ if (i_fwing || i_fwers) {
+ xs *s = xs_fmt(L("%d following, %d followers"), i_fwing, i_fwers);
+
+ xs_html_add(snac_post,
+ xs_html_tag("div",
+ xs_html_tag("p",
+ xs_html_text(s))));
+ }
}
/* add user metadata */