From 96c725328b556833d59de23093fb4aeba9bb5684 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 16 Feb 2019 20:38:25 +0300 Subject: [PATCH] Remove a limit on attachments in Mastodon API and document the changes in responses from vanilla mastodon --- docs/Differences-in-MastodonAPI-Responses.md | 9 +++++++++ lib/pleroma/web/mastodon_api/views/status_view.ex | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 docs/Differences-in-MastodonAPI-Responses.md diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md new file mode 100644 index 000000000..cfa34593e --- /dev/null +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -0,0 +1,9 @@ +# Differences in Mastodon API responses from vanilla Mastodon + +## Flake IDs + +Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings + +## Attachment cap + +Some apps operate under the assumption that no more than 4 attachments ccan be returned, however Pleroma can return any amount of attachments diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 69f5f992c..a49b381c9 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -166,7 +166,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} sensitive: sensitive, spoiler_text: object["summary"] || "", visibility: get_visibility(object), - media_attachments: attachments |> Enum.take(4), + media_attachments: attachments, mentions: mentions, tags: build_tags(tags), application: %{