summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-04-02 23:07:16 +0300
committerrinpatch <rinpatch@sdf.org>2019-04-02 23:07:16 +0300
commit79cb34a4b0dd1c0ffe45e796f5ac6790e3b31025 (patch)
treeaaf5f1356760ba2ea60792e457418d989f0a978b
parent0cb94cfa945632e2a1825bb64fe4036ebbf22001 (diff)
downloadpleroma-79cb34a4b0dd1c0ffe45e796f5ac6790e3b31025.tar.gz
pleroma-79cb34a4b0dd1c0ffe45e796f5ac6790e3b31025.zip
Fix preview not being usable in form data
-rw-r--r--docs/api/differences_in_mastoapi_responses.md2
-rw-r--r--lib/pleroma/web/common_api/common_api.ex2
2 files changed, 2 insertions, 2 deletions
diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md
index 7adf29676..215f43155 100644
--- a/docs/api/differences_in_mastoapi_responses.md
+++ b/docs/api/differences_in_mastoapi_responses.md
@@ -47,6 +47,6 @@ Has these additional fields under the `pleroma` object:
## POST `/api/v1/statuses`
-Additional parameters can be added to the JSON body:
+Additional parameters can be added to the JSON body/Form data:
- `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example.
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 2f82a32f3..745d1839b 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -180,7 +180,7 @@ defmodule Pleroma.Web.CommonAPI do
object: object,
additional: %{"cc" => cc, "directMessage" => visibility == "direct"}
},
- data["preview"] || false
+ Pleroma.Web.ControllerHelper.truthy_param?(data["preview"]) || false
)
res