diff options
| -rw-r--r-- | html.c | 25 |
1 files changed, 7 insertions, 18 deletions
| @@ -2148,11 +2148,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2148 | 2148 | ||
| 2149 | v = xs_dict_get(msg, "summary"); | 2149 | v = xs_dict_get(msg, "summary"); |
| 2150 | 2150 | ||
| 2151 | /* is it sensitive? */ | 2151 | if (!xs_is_null(v) && *v) { |
| 2152 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2153 | if (xs_is_null(v) || *v == '\0') | ||
| 2154 | v = "..."; | ||
| 2155 | |||
| 2156 | const char *cw = ""; | 2152 | const char *cw = ""; |
| 2157 | 2153 | ||
| 2158 | if (user) { | 2154 | if (user) { |
| @@ -2162,23 +2158,16 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2162 | cw = ""; | 2158 | cw = ""; |
| 2163 | } | 2159 | } |
| 2164 | 2160 | ||
| 2161 | xs_html *summary_tag = xs_html_tag("summary", xs_html_text(v)); | ||
| 2162 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2163 | xs_html_add(summary_tag, xs_html_text(L(" [SENSITIVE CONTENT]"))); | ||
| 2164 | } | ||
| 2165 | |||
| 2165 | snac_content = xs_html_tag("details", | 2166 | snac_content = xs_html_tag("details", |
| 2166 | xs_html_attr(cw, NULL), | 2167 | xs_html_attr(cw, NULL), |
| 2167 | xs_html_tag("summary", | 2168 | summary_tag); |
| 2168 | xs_html_text(v), | ||
| 2169 | xs_html_text(L(" [SENSITIVE CONTENT]")))); | ||
| 2170 | } | 2169 | } |
| 2171 | else { | 2170 | else { |
| 2172 | /* print the summary as a header (sites like e.g. Friendica can contain one) */ | ||
| 2173 | if (!has_title && !xs_is_null(v) && *v) { | ||
| 2174 | xs_html_add(snac_content_wrap, | ||
| 2175 | xs_html_tag("h3", | ||
| 2176 | xs_html_attr("class", "snac-entry-title"), | ||
| 2177 | xs_html_text(v))); | ||
| 2178 | |||
| 2179 | has_title = 1; | ||
| 2180 | } | ||
| 2181 | |||
| 2182 | snac_content = xs_html_tag("div", NULL); | 2171 | snac_content = xs_html_tag("div", NULL); |
| 2183 | } | 2172 | } |
| 2184 | 2173 | ||