commit ac711dd

grunfink  ·  2026-08-05 16:06:14 +0000 UTC
parent 460b6cc
mastoapi: fixed bug while changing the sensitive content string.
1 files changed,  +10, -0
+10, -0
 1@@ -4251,6 +4251,16 @@ int mastoapi_put_handler(const xs_dict *req, const char *q_path,
 2 
 3                     msg = xs_dict_set(msg, "tag", tag);
 4 
 5+                    if (xs_is_true(xs_dict_get(args, "sensitive"))) {
 6+                        const char *spoiler_text = xs_dict_get(args, "spoiler_text");
 7+                        msg = xs_dict_set(msg, "summary", spoiler_text);
 8+                        msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE));
 9+                    }
10+                    else {
11+                        msg = xs_dict_set(msg, "summary", "");
12+                        msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_FALSE));
13+                    }
14+
15                     /* overwrite object, not updating the indexes */
16                     const char *id = xs_dict_get(msg, "id");
17