X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fpleroma_api%2Fviews%2Fchat_message_view.ex;h=a821479ab7a3fac98a0bbc73707b01fb3c4c8a46;hb=b5dc59c8fa587b4db844c7fc0ba16e5cb00bfd38;hp=2df5913584b83688e807ebf9419b1bec5e7abd1d;hpb=6ace22b56a3ced833bd990de5715048d6bd32f80;p=akkoma diff --git a/lib/pleroma/web/pleroma_api/views/chat_message_view.ex b/lib/pleroma/web/pleroma_api/views/chat_message_view.ex index 2df591358..a821479ab 100644 --- a/lib/pleroma/web/pleroma_api/views/chat_message_view.ex +++ b/lib/pleroma/web/pleroma_api/views/chat_message_view.ex @@ -6,6 +6,9 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageView do use Pleroma.Web, :view alias Pleroma.Chat + alias Pleroma.User + alias Pleroma.Web.CommonAPI.Utils + alias Pleroma.Web.MastodonAPI.StatusView def render( "show.json", @@ -15,10 +18,12 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageView do } ) do %{ - id: id, + id: id |> to_string(), content: chat_message["content"], - chat_id: chat_id, - actor: chat_message["actor"] + chat_id: chat_id |> to_string(), + account_id: User.get_cached_by_ap_id(chat_message["actor"]).id, + created_at: Utils.to_masto_date(chat_message["published"]), + emojis: StatusView.build_emojis(chat_message["emoji"]) } end