logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 7c003991d60804e0f3ff0758bd3e6d8044b40e68
parent: 0cb94cfa945632e2a1825bb64fe4036ebbf22001
Author: lambda <lain@soykaf.club>
Date:   Wed,  3 Apr 2019 06:51:44 +0000

Merge branch 'fix/preview-not-working-with-form-data' into 'develop'

Fix preview not being usable in form data

See merge request pleroma/pleroma!1013

Diffstat:

Mdocs/api/differences_in_mastoapi_responses.md2+-
Mlib/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 @@ -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 @@ -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