From 2614a8b3cbf55ab2a38ae2c81fe0081579495190 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 2 Dec 2022 21:36:12 +0100 Subject: Show stray parents in the origin. --- html.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 43f064f..65ea5e1 100644 --- a/html.c +++ b/html.c @@ -591,31 +591,21 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int } } } - -#if 0 - if (!xs_is_null((p = xs_dict_get(meta, "parent"))) && *p) { - /* this may happen if any of the autor or the parent aren't here */ - xs *s1 = xs_fmt( - "
%s " - "»
\n", - L("in reply to"), p - ); - - s = xs_str_cat(s, s1); - } else - if (!xs_is_null((p = xs_dict_get(meta, "liked_by"))) && - xs_list_in(p, snac->actor) != -1) { - /* we liked this */ - xs *s1 = xs_fmt( - "
" - "%s %s
", - snac->actor, xs_dict_get(snac->config, "name"), L("liked") - ); + if (strcmp(type, "Note") == 0) { + /* is the parent not here? */ + char *parent = xs_dict_get(msg, "inReplyTo"); - s = xs_str_cat(s, s1); + if (!xs_is_null(parent) && !object_here(parent)) { + xs *s1 = xs_fmt( + "
%s " + "»
\n", + L("in reply to"), parent + ); + + s = xs_str_cat(s, s1); + } } -#endif } else s = xs_str_cat(s, "
\n"); -- cgit v1.2.3