summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-06-06 07:39:55 +0200
committerdefault <nobody@localhost>2024-06-06 07:39:55 +0200
commitd668fddd2fc9ebb9a5fdf20103ba7d4f876ed508 (patch)
tree07cf55911f7125fcf9e44cca44effd9116affa60 /html.c
parent5b8c96e6b64d3499cc4111c13abed5c787b32100 (diff)
Fixed CW dropdown in public instance timeline.
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/html.c b/html.c
index 0c66917..0d157c8 100644
--- a/html.c
+++ b/html.c
@@ -1632,14 +1632,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
v = xs_dict_get(msg, "summary");
/* is it sensitive? */
- if (user && xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
+ if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
if (xs_is_null(v) || *v == '\0')
v = "...";
- /* only show it when not in the public timeline and the config setting is "open" */
- const char *cw = xs_dict_get(user->config, "cw");
- if (xs_is_null(cw) || read_only)
- cw = "";
+ const char *cw = "";
+
+ if (user) {
+ /* only show it when not in the public timeline and the config setting is "open" */
+ cw = xs_dict_get(user->config, "cw");
+ if (xs_is_null(cw) || read_only)
+ cw = "";
+ }
snac_content = xs_html_tag("details",
xs_html_attr(cw, NULL),