1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.Emoji
13 description: "Response schema for a ChatMessage",
17 id: %Schema{type: :string},
18 account_id: %Schema{type: :string, description: "The Mastodon API id of the actor"},
19 chat_id: %Schema{type: :string},
20 content: %Schema{type: :string, nullable: true},
21 created_at: %Schema{type: :string, format: :"date-time"},
22 emojis: %Schema{type: :array, items: Emoji},
23 attachment: %Schema{type: :object, nullable: true},
27 description: "Preview card for links included within status content",
28 required: [:url, :title, :description, :type],
32 enum: ["link", "photo", "video", "rich"],
33 description: "The type of the preview card"
35 provider_name: %Schema{
38 description: "The provider of the original resource"
40 provider_url: %Schema{
43 description: "A link to the provider of the original resource"
45 url: %Schema{type: :string, format: :uri, description: "Location of linked resource"},
50 description: "Preview thumbnail"
52 title: %Schema{type: :string, description: "Title of linked resource"},
53 description: %Schema{type: :string, description: "Description of preview"}
56 unread: %Schema{type: :boolean, description: "Whether a message has been marked as read."}
59 "account_id" => "someflakeid",
61 "content" => "hey you again",
62 "created_at" => "2020-04-21T15:06:45.000Z",
66 "static_url" => "https://dontbulling.me/emoji/Firefox.gif",
67 "visible_in_picker" => false,
68 "shortcode" => "firefox",
69 "url" => "https://dontbulling.me/emoji/Firefox.gif"