snac2

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

commit 5d126d0e9ed2763fa6db1d533d33069a74db8b0f
parent 03ed4d53098336c583d7258d0692b0b13e770563
Author: default <nobody@localhost>
Date:   Wed,  8 Feb 2023 14:07:13 +0100

Only show the 'in reply to' link if level == 0.

Diffstat:
Mhtml.c | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/html.c b/html.c @@ -702,17 +702,19 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, cons } else if (strcmp(type, "Note") == 0) { - /* is the parent not here? */ - char *parent = xs_dict_get(msg, "inReplyTo"); + if (level == 0) { + /* is the parent not here? */ + char *parent = xs_dict_get(msg, "inReplyTo"); - if (!xs_is_null(parent) && *parent && !timeline_here(snac, parent)) { - xs *s1 = xs_fmt( - "<div class=\"snac-origin\">%s " - "<a href=\"%s\">»</a></div>\n", - L("in reply to"), parent - ); + if (!xs_is_null(parent) && *parent && !timeline_here(snac, parent)) { + xs *s1 = xs_fmt( + "<div class=\"snac-origin\">%s " + "<a href=\"%s\">»</a></div>\n", + L("in reply to"), parent + ); - s = xs_str_cat(s, s1); + s = xs_str_cat(s, s1); + } } }