diff options
| author | grunfink <grunfink@comam.es> | 2026-08-05 18:06:14 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2026-08-05 18:06:14 +0200 |
| commit | ac711dd42297c24ee2342d316d4b78e3e88912af (patch) | |
| tree | 3e20cafbc20824b4e3a33a4043e493ba4a95bc4c | |
| parent | 460b6cc5891d54281bba6bcedd542d38c0bc4814 (diff) | |
mastoapi: fixed bug while changing the sensitive content string.
| -rw-r--r-- | mastoapi.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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"); |