Hide the children for polls.

This commit is contained in:
default 2023-05-24 13:25:13 +02:00
parent 6eb0aa105a
commit 9cdb53de8e

12
html.c
View file

@ -745,7 +745,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
return os; return os;
s = xs_str_cat(s, "<div class=\"snac-score\">"); s = xs_str_cat(s, "<div class=\"snac-score\">"); /** **/
if (strcmp(type, "Question") == 0) { if (strcmp(type, "Question") == 0) {
/* add the ballot box emoji */ /* add the ballot box emoji */
@ -768,9 +768,9 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
s = xs_str_cat(s, "</div>\n"); s = xs_str_cat(s, "</div>\n");
if (level == 0) if (level == 0)
s = xs_str_cat(s, "<div class=\"snac-post\">\n"); s = xs_str_cat(s, "<div class=\"snac-post\">\n"); /** **/
else else
s = xs_str_cat(s, "<div class=\"snac-child\">\n"); s = xs_str_cat(s, "<div class=\"snac-child\">\n"); /** **/
if (boosts == NULL) if (boosts == NULL)
boosts = object_announces(id); boosts = object_announces(id);
@ -828,7 +828,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
s = html_msg_icon(snac, s, msg); s = html_msg_icon(snac, s, msg);
/* add the content */ /* add the content */
s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n"); s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n"); /** **/
/* is it sensitive? */ /* is it sensitive? */
if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) { if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) {
@ -974,7 +974,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
/* add the attachments */ /* add the attachments */
char *attach; char *attach;
if ((attach = xs_dict_get(msg, "attachment")) != NULL) { if ((attach = xs_dict_get(msg, "attachment")) != NULL) { /** **/
char *v; char *v;
while (xs_list_iter(&attach, &v)) { while (xs_list_iter(&attach, &v)) {
char *t = xs_dict_get(v, "mediaType"); char *t = xs_dict_get(v, "mediaType");
@ -1017,7 +1017,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
s = html_entry_controls(snac, s, msg, md5); s = html_entry_controls(snac, s, msg, md5);
/** children **/ /** children **/
if (!hide_children) { if (!hide_children && strcmp(type, "Question") != 0) {
xs *children = object_children(id); xs *children = object_children(id);
int left = xs_list_len(children); int left = xs_list_len(children);