aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-11 01:48:19 +0100
committerdefault <nobody@localhost>2025-01-11 01:48:19 +0100
commit9d4d740220c79e13d2c1f95ba91405f24c90b287 (patch)
tree887ec0d41bb507dc1e33f30f7843559e94e5b338
parentff44142b30ceded6ed7db24d033296b0966edb27 (diff)
mastoapi: obey the "unlisted" visibility set by apps.
-rw-r--r--mastoapi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 4b89d12..16065ec 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -2650,8 +2650,14 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
}
/* prepare the message */
- xs *msg = msg_note(&snac, content, NULL, irt, attach_list,
- strcmp(visibility, "public") == 0 ? 0 : 1, language);
+ int scope = 1;
+ if (strcmp(visibility, "unlisted") == 0)
+ scope = 2;
+ else
+ if (strcmp(visibility, "public") == 0)
+ scope = 0;
+
+ xs *msg = msg_note(&snac, content, NULL, irt, attach_list, scope, language);
if (!xs_is_null(summary) && *summary) {
msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE));