]> git.mxchange.org Git - friendica.git/commitdiff
"sensitive" is added to the API
authorMichael <heluecht@pirati.ca>
Tue, 6 Feb 2024 16:30:46 +0000 (16:30 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 6 Feb 2024 16:30:46 +0000 (16:30 +0000)
src/Module/Api/Mastodon/Statuses.php

index d194e97e31f4d9e454cea74cab88522265dadcf6..33b9b3b83048236ecca892e6ef5297f33495a4fb 100644 (file)
@@ -55,6 +55,7 @@ class Statuses extends BaseApi
                        'status'           => '',    // Text content of the status. If media_ids is provided, this becomes optional. Attaching a poll is optional while status is provided.
                        'media_ids'        => [],    // Array of Attachment ids to be attached as media. If provided, status becomes optional, and poll cannot be used.
                        'in_reply_to_id'   => 0,     // ID of the status being replied to, if status is a reply
+                       'sensitive'        => false, // Mark status and attached media as sensitive? Defaults to false.
                        'spoiler_text'     => '',    // Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field.
                        'language'         => '',    // ISO 639 language code for this status.
                        'media_attributes' => [],
@@ -83,6 +84,7 @@ class Statuses extends BaseApi
                $item['gravity']    = $post['gravity'];
                $item['verb']       = $post['verb'];
                $item['app']        = $this->getApp();
+               $item['sensitive']  = $request['sensitive'];
 
                if (!empty($request['language'])) {
                        $item['language'] = json_encode([$request['language'] => 1]);
@@ -179,7 +181,7 @@ class Statuses extends BaseApi
                        'poll'           => [],    // Poll data. If provided, media_ids cannot be used, and poll[expires_in] must be provided.
                        'in_reply_to_id' => 0,     // ID of the status being replied to, if status is a reply
                        'quote_id'       => 0,     // ID of the message to quote
-                       'sensitive'      => false, // Mark status and attached media as sensitive?
+                       'sensitive'      => false, // Mark status and attached media as sensitive? Defaults to false.
                        'spoiler_text'   => '',    // Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field.
                        'visibility'     => '',    // Visibility of the posted status. One of: "public", "unlisted", "private" or "direct".
                        'scheduled_at'   => '',    // ISO 8601 Datetime at which to schedule a status. Providing this parameter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future.
@@ -198,6 +200,7 @@ class Statuses extends BaseApi
                $item['title']      = '';
                $item['body']       = $this->formatStatus($request['status'], $uid);
                $item['app']        = $this->getApp();
+               $item['sensitive']  = $request['sensitive'];
                $item['visibility'] = $request['visibility'];
 
                switch ($request['visibility']) {