From ac711dd42297c24ee2342d316d4b78e3e88912af Mon Sep 17 00:00:00 2001 From: grunfink Date: Wed, 5 Aug 2026 18:06:14 +0200 Subject: mastoapi: fixed bug while changing the sensitive content string. --- mastoapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mastoapi.c b/mastoapi.c index 4139af1..d29ff01 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -4251,6 +4251,16 @@ int mastoapi_put_handler(const xs_dict *req, const char *q_path, msg = xs_dict_set(msg, "tag", tag); + if (xs_is_true(xs_dict_get(args, "sensitive"))) { + const char *spoiler_text = xs_dict_get(args, "spoiler_text"); + msg = xs_dict_set(msg, "summary", spoiler_text); + msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE)); + } + else { + msg = xs_dict_set(msg, "summary", ""); + msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_FALSE)); + } + /* overwrite object, not updating the indexes */ const char *id = xs_dict_get(msg, "id"); -- cgit