Expose content type of status sources
This commit is contained in:
parent
72ac940618
commit
fe2d4778ee
6 changed files with 73 additions and 5 deletions
|
|
@ -224,7 +224,10 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
|
|||
object =
|
||||
note_data
|
||||
|> Map.put("emoji", emoji)
|
||||
|> Map.put("source", draft.status)
|
||||
|> Map.put("source", %{
|
||||
"content" => draft.status,
|
||||
"mediaType" => Utils.get_content_type(draft.params[:content_type])
|
||||
})
|
||||
|> Map.put("generator", draft.params[:generator])
|
||||
|
||||
%__MODULE__{draft | object: object}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|
|||
|> maybe_add_attachments(draft.attachments, attachment_links)
|
||||
end
|
||||
|
||||
defp get_content_type(content_type) do
|
||||
def get_content_type(content_type) do
|
||||
if Enum.member?(Config.get([:instance, :allowed_post_formats]), content_type) do
|
||||
content_type
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue