summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-12-02 21:36:12 +0100
committerdefault <nobody@localhost>2022-12-02 21:36:12 +0100
commit2614a8b3cbf55ab2a38ae2c81fe0081579495190 (patch)
treead65e4dfea2f8b048b1f0bcea8835d9e61e0a1a9 /html.c
parentadfc9217d739dadd0099797cbf5cb6dc6594c72c (diff)
Show stray parents in the origin.
Diffstat (limited to 'html.c')
-rw-r--r--html.c34
1 files changed, 12 insertions, 22 deletions
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(
- "<div class=\"snac-origin\">%s "
- "<a href=\"%s\">»</a></div>\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(
- "<div class=\"snac-origin\">"
- "<a href=\"%s\">%s</a> %s</a></div>",
- 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(
+ "<div class=\"snac-origin\">%s "
+ "<a href=\"%s\">»</a></div>\n",
+ L("in reply to"), parent
+ );
+
+ s = xs_str_cat(s, s1);
+ }
}
-#endif
}
else
s = xs_str_cat(s, "<div class=\"snac-child\">\n");