commit d668fdd

default  ·  2024-06-06 05:39:55 +0000 UTC
parent 5b8c96e
Fixed CW dropdown in public instance timeline.
1 files changed,  +9, -5
M html.c
M html.c
+9, -5
 1@@ -1632,14 +1632,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2     v = xs_dict_get(msg, "summary");
 3 
 4     /* is it sensitive? */
 5-    if (user && xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
 6+    if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
 7         if (xs_is_null(v) || *v == '\0')
 8             v = "...";
 9 
10-        /* only show it when not in the public timeline and the config setting is "open" */
11-        const char *cw = xs_dict_get(user->config, "cw");
12-        if (xs_is_null(cw) || read_only)
13-            cw = "";
14+        const char *cw = "";
15+
16+        if (user) {
17+            /* only show it when not in the public timeline and the config setting is "open" */
18+            cw = xs_dict_get(user->config, "cw");
19+            if (xs_is_null(cw) || read_only)
20+                cw = "";
21+        }
22 
23         snac_content = xs_html_tag("details",
24             xs_html_attr(cw, NULL),