ChatMessages: Add attachments.

This commit is contained in:
lain 2020-05-06 16:12:36 +02:00
commit 20baa2eaf0
14 changed files with 237 additions and 24 deletions

View file

@ -236,7 +236,8 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
description: "POST body for creating an chat message",
type: :object,
properties: %{
content: %Schema{type: :string, description: "The content of your message"}
content: %Schema{type: :string, description: "The content of your message"},
media_id: %Schema{type: :string, description: "The id of an upload"}
},
required: [:content],
example: %{

View file

@ -17,7 +17,8 @@ defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
chat_id: %Schema{type: :string},
content: %Schema{type: :string},
created_at: %Schema{type: :string, format: :"date-time"},
emojis: %Schema{type: :array}
emojis: %Schema{type: :array},
attachment: %Schema{type: :object, nullable: true}
},
example: %{
"account_id" => "someflakeid",
@ -32,7 +33,8 @@ defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
"url" => "https://dontbulling.me/emoji/Firefox.gif"
}
],
"id" => "14"
"id" => "14",
"attachment" => nil
}
})
end