commit 0d32db4
grunfink
·
2025-11-09 08:28:34 +0000 UTC
parent 074072b
Show quoted posts.
1 files changed,
+15,
-0
M
html.c
M
html.c
+15,
-0
1@@ -2394,6 +2394,21 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2 /* c contains sanitized HTML */
3 xs_html_add(snac_content,
4 xs_html_raw(c));
5+
6+ /* quoted post */
7+ const char *quoted_id = xs_dict_get(msg, "quote");
8+ if (xs_is_string(quoted_id)) {
9+ xs *quoted_post = NULL;
10+
11+ if (valid_status(object_get(quoted_id, "ed_post))) {
12+ xs_html_add(snac_content,
13+ xs_html_tag("blockquote",
14+ xs_html_attr("class", "snac-quoted-post"),
15+ html_entry(user, quoted_post, 1, 1, NULL, 1)));
16+ }
17+ else
18+ enqueue_object_request(user, quoted_id, 0);
19+ }
20 }
21
22 if (strcmp(type, "Question") == 0) { /** question content **/