diff options
| author | grunfink <grunfink@comam.es> | 2026-04-11 08:59:12 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2026-04-11 08:59:12 +0200 |
| commit | d8eaa95eb2dea542d93a98ce12b3ba36cd639a45 (patch) | |
| tree | 3313559998aa433fbc607b50f751f8cbe3726f1d | |
| parent | 82493015e54b10463594c913bd57c479a1e0bc2d (diff) | |
Even if follow metrics are available in the actor object, don't show if both are 0.
| -rw-r--r-- | html.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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 */ |