1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.PleromaAPI.ChatMessageView do
13 object: %{id: id, data: %{"type" => "ChatMessage"} = chat_message},
14 chat: %Chat{id: chat_id}
18 id: id |> to_string(),
19 content: chat_message["content"],
20 chat_id: chat_id |> to_string(),
21 actor: chat_message["actor"]
25 def render("index.json", opts) do
26 render_many(opts[:objects], __MODULE__, "show.json", Map.put(opts, :as, :object))