commit: 3a77336d8999bed45518420c9f8b47d89dcf1f4d
parent: 5294b11ef092df386b29896e47795edac8364f20
Author: kaniini <nenolod@gmail.com>
Date: Wed, 10 Oct 2018 08:00:23 +0000
Merge branch 'bugfix/length-enforce-subjects' into 'develop'
common api: take the combination of the subject and content for length limit enforcement
Closes #315
See merge request pleroma/pleroma!371
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
@@ -83,7 +83,6 @@ defmodule Pleroma.Web.CommonAPI do
visibility = get_visibility(data)
with status <- String.trim(status),
- length when length in 1..@limit <- String.length(status),
attachments <- attachments_from_ids(data["media_ids"]),
mentions <- Formatter.parse_mentions(status),
inReplyTo <- get_replied_to_activity(data["in_reply_to_status_id"]),
@@ -100,6 +99,8 @@ defmodule Pleroma.Web.CommonAPI do
),
context <- make_context(inReplyTo),
cw <- data["spoiler_text"],
+ full_payload <- String.trim(status <> (data["spoiler_text"] || "")),
+ length when length in 1..@limit <- String.length(full_payload),
object <-
make_note_data(
user.ap_id,