common api: take the combination of the subject and content for length limit enforcement
closes #315
This commit is contained in:
parent
5294b11ef0
commit
111841ad34
1 changed files with 2 additions and 1 deletions
|
@ -83,7 +83,6 @@ defmodule Pleroma.Web.CommonAPI do
|
||||||
visibility = get_visibility(data)
|
visibility = get_visibility(data)
|
||||||
|
|
||||||
with status <- String.trim(status),
|
with status <- String.trim(status),
|
||||||
length when length in 1..@limit <- String.length(status),
|
|
||||||
attachments <- attachments_from_ids(data["media_ids"]),
|
attachments <- attachments_from_ids(data["media_ids"]),
|
||||||
mentions <- Formatter.parse_mentions(status),
|
mentions <- Formatter.parse_mentions(status),
|
||||||
inReplyTo <- get_replied_to_activity(data["in_reply_to_status_id"]),
|
inReplyTo <- get_replied_to_activity(data["in_reply_to_status_id"]),
|
||||||
|
@ -100,6 +99,8 @@ defmodule Pleroma.Web.CommonAPI do
|
||||||
),
|
),
|
||||||
context <- make_context(inReplyTo),
|
context <- make_context(inReplyTo),
|
||||||
cw <- data["spoiler_text"],
|
cw <- data["spoiler_text"],
|
||||||
|
full_payload <- String.trim(status <> (data["spoiler_text"] || "")),
|
||||||
|
length when length in 1..@limit <- String.length(full_payload),
|
||||||
object <-
|
object <-
|
||||||
make_note_data(
|
make_note_data(
|
||||||
user.ap_id,
|
user.ap_id,
|
||||||
|
|
Loading…
Reference in a new issue