summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar default2025-01-11 01:48:19 +0100
committerGravatar default2025-01-11 01:48:19 +0100
commit9d4d740220c79e13d2c1f95ba91405f24c90b287 (patch)
tree887ec0d41bb507dc1e33f30f7843559e94e5b338 /mastoapi.c
parentMoved creation of "quiet public" posts to msg_note(), where it belongs. (diff)
downloadpenes-snac2-9d4d740220c79e13d2c1f95ba91405f24c90b287.tar.gz
penes-snac2-9d4d740220c79e13d2c1f95ba91405f24c90b287.tar.xz
penes-snac2-9d4d740220c79e13d2c1f95ba91405f24c90b287.zip
mastoapi: obey the "unlisted" visibility set by apps.
Diffstat (limited to 'mastoapi.c')
-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,
2650 } 2650 }
2651 2651
2652 /* prepare the message */ 2652 /* prepare the message */
2653 xs *msg = msg_note(&snac, content, NULL, irt, attach_list, 2653 int scope = 1;
2654 strcmp(visibility, "public") == 0 ? 0 : 1, language); 2654 if (strcmp(visibility, "unlisted") == 0)
2655 scope = 2;
2656 else
2657 if (strcmp(visibility, "public") == 0)
2658 scope = 0;
2659
2660 xs *msg = msg_note(&snac, content, NULL, irt, attach_list, scope, language);
2655 2661
2656 if (!xs_is_null(summary) && *summary) { 2662 if (!xs_is_null(summary) && *summary) {
2657 msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE)); 2663 msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE));