diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/api_spec/schemas/chat_message_response.ex | 2 | ||||
| -rw-r--r-- | lib/pleroma/web/pleroma_api/views/chat_message_view.ex | 2 | 
2 files changed, 4 insertions, 0 deletions
| diff --git a/lib/pleroma/web/api_spec/schemas/chat_message_response.ex b/lib/pleroma/web/api_spec/schemas/chat_message_response.ex index e94c00369..9459d210b 100644 --- a/lib/pleroma/web/api_spec/schemas/chat_message_response.ex +++ b/lib/pleroma/web/api_spec/schemas/chat_message_response.ex @@ -14,6 +14,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse do      properties: %{        id: %Schema{type: :string},        actor: %Schema{type: :string, description: "The ActivityPub id of the actor"}, +      actor_account_id: %Schema{type: :string, description: "The Mastodon API id of the actor"},        chat_id: %Schema{type: :string},        content: %Schema{type: :string},        created_at: %Schema{type: :string, format: :datetime}, @@ -21,6 +22,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse do      },      example: %{        "actor" => "https://dontbulling.me/users/lain", +      "actor_account_id" => "someflakeid",        "chat_id" => "1",        "content" => "hey you again",        "created_at" => "2020-04-21T15:06:45.000Z", 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 b40ab92a0..5b740cc44 100644 --- a/lib/pleroma/web/pleroma_api/views/chat_message_view.ex +++ b/lib/pleroma/web/pleroma_api/views/chat_message_view.ex @@ -8,6 +8,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageView do    alias Pleroma.Chat    alias Pleroma.Web.CommonAPI.Utils    alias Pleroma.Web.MastodonAPI.StatusView +  alias Pleroma.User    def render(          "show.json", @@ -21,6 +22,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageView do        content: chat_message["content"],        chat_id: chat_id |> to_string(),        actor: chat_message["actor"], +      actor_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"])      } | 
