aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-22 15:47:21 +0100
committerdefault <nobody@localhost>2025-01-22 15:47:21 +0100
commit0f0e33f5f6f49b9b4055b24761559b11c80da45e (patch)
tree9cd7fee44cc295af43c921d349f4884ee29d8cb5 /html.c
parentced28f931928fac1ded3e435868c3ca204b9280b (diff)
Fixed bug in 'in reply to' checking.
Diffstat (limited to 'html.c')
-rw-r--r--html.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/html.c b/html.c
index fcf2904..a15bd06 100644
--- a/html.c
+++ b/html.c
@@ -1856,19 +1856,23 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
}
}
- if (strcmp(type, "Note") == 0) {
+ if (user && strcmp(type, "Note") == 0) {
/* is the parent not here? */
const char *parent = get_in_reply_to(msg);
- if (user && !xs_is_null(parent) && *parent && !timeline_here(user, parent)) {
- xs_html_add(post_header,
- xs_html_tag("div",
- xs_html_attr("class", "snac-origin"),
- xs_html_text(L("in reply to")),
- xs_html_text(" "),
- xs_html_tag("a",
- xs_html_attr("href", parent),
- xs_html_text("»"))));
+ if (!xs_is_null(parent) && *parent) {
+ xs *md5 = xs_md5_hex(parent, strlen(parent));
+
+ if (!timeline_here(user, md5)) {
+ xs_html_add(post_header,
+ xs_html_tag("div",
+ xs_html_attr("class", "snac-origin"),
+ xs_html_text(L("in reply to")),
+ xs_html_text(" "),
+ xs_html_tag("a",
+ xs_html_attr("href", parent),
+ xs_html_text("»"))));
+ }
}
}