commit 9d4d740
default
·
2025-01-11 00:48:19 +0000 UTC
parent ff44142
mastoapi: obey the "unlisted" visibility set by apps.
1 files changed,
+8,
-2
+8,
-2
1@@ -2650,8 +2650,14 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
2 }
3
4 /* prepare the message */
5- xs *msg = msg_note(&snac, content, NULL, irt, attach_list,
6- strcmp(visibility, "public") == 0 ? 0 : 1, language);
7+ int scope = 1;
8+ if (strcmp(visibility, "unlisted") == 0)
9+ scope = 2;
10+ else
11+ if (strcmp(visibility, "public") == 0)
12+ scope = 0;
13+
14+ xs *msg = msg_note(&snac, content, NULL, irt, attach_list, scope, language);
15
16 if (!xs_is_null(summary) && *summary) {
17 msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE));