commit 9cdb53d
default
·
2023-05-24 11:25:13 +0000 UTC
parent 6eb0aa1
Hide the children for polls.
1 files changed,
+6,
-6
M
html.c
M
html.c
+6,
-6
1@@ -745,7 +745,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
2 if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
3 return os;
4
5- s = xs_str_cat(s, "<div class=\"snac-score\">");
6+ s = xs_str_cat(s, "<div class=\"snac-score\">"); /** **/
7
8 if (strcmp(type, "Question") == 0) {
9 /* add the ballot box emoji */
10@@ -768,9 +768,9 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
11 s = xs_str_cat(s, "</div>\n");
12
13 if (level == 0)
14- s = xs_str_cat(s, "<div class=\"snac-post\">\n");
15+ s = xs_str_cat(s, "<div class=\"snac-post\">\n"); /** **/
16 else
17- s = xs_str_cat(s, "<div class=\"snac-child\">\n");
18+ s = xs_str_cat(s, "<div class=\"snac-child\">\n"); /** **/
19
20 if (boosts == NULL)
21 boosts = object_announces(id);
22@@ -828,7 +828,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
23 s = html_msg_icon(snac, s, msg);
24
25 /* add the content */
26- s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n");
27+ s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n"); /** **/
28
29 /* is it sensitive? */
30 if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) {
31@@ -974,7 +974,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
32 /* add the attachments */
33 char *attach;
34
35- if ((attach = xs_dict_get(msg, "attachment")) != NULL) {
36+ if ((attach = xs_dict_get(msg, "attachment")) != NULL) { /** **/
37 char *v;
38 while (xs_list_iter(&attach, &v)) {
39 char *t = xs_dict_get(v, "mediaType");
40@@ -1017,7 +1017,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
41 s = html_entry_controls(snac, s, msg, md5);
42
43 /** children **/
44- if (!hide_children) {
45+ if (!hide_children && strcmp(type, "Question") != 0) {
46 xs *children = object_children(id);
47 int left = xs_list_len(children);
48