snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit c12acc0cc9a5037570207a84f5eaa5e6c849764c
parent d50b0391044ed0c15ea996577164300bd518c0e9
Author: default <nobody@localhost>
Date:   Fri, 15 Mar 2024 19:20:24 +0100

Also hide Older... posts details if it's empty.

Diffstat:
Mhtml.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/html.c b/html.c @@ -1859,6 +1859,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_list *p = children; char *cmd5; int cnt = 0; + int o_cnt = 0; while (xs_list_iter(&p, &cmd5)) { xs *chd = NULL; @@ -1874,9 +1875,12 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, level + 1, cmd5, hide_children); if (che != NULL) { - if (left > 3) + if (left > 3) { xs_html_add(ch_older, che); + + o_cnt++; + } else xs_html_add(ch_container, che); @@ -1895,6 +1899,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, if (cnt == 0) xs_html_add(ch_details, xs_html_attr("style", "display: none")); + + if (o_cnt == 0 && ch_older) + xs_html_add(ch_older, + xs_html_attr("style", "display: none")); } }