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

This commit is contained in:
default 2023-02-08 14:07:13 +01:00
parent 03ed4d5309
commit 5d126d0e9e

20
html.c
View file

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