mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
Merge branch 'mastoapi/mime_type' into 'develop'
Extend MastoAPI to provide attachment mimetypes See merge request pleroma/pleroma!938
This commit is contained in:
commit
41fc67aa49
3 changed files with 10 additions and 2 deletions
|
@ -20,6 +20,12 @@ Has these additional fields under the `pleroma` object:
|
|||
|
||||
- `local`: true if the post was made on the local instance.
|
||||
|
||||
## Attachments
|
||||
|
||||
Has these additional fields under the `pleroma` object:
|
||||
|
||||
- `mime_type`: mime type of the attachment.
|
||||
|
||||
## Accounts
|
||||
|
||||
- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc.
|
||||
|
|
|
@ -257,7 +257,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
preview_url: href,
|
||||
text_url: href,
|
||||
type: type,
|
||||
description: attachment["name"]
|
||||
description: attachment["name"],
|
||||
pleroma: %{mime_type: media_type}
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -196,7 +196,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
remote_url: "someurl",
|
||||
preview_url: "someurl",
|
||||
text_url: "someurl",
|
||||
description: nil
|
||||
description: nil,
|
||||
pleroma: %{mime_type: "image/png"}
|
||||
}
|
||||
|
||||
assert expected == StatusView.render("attachment.json", %{attachment: object})
|
||||
|
|
Loading…
Reference in a new issue