distraction.party/lib/pleroma/web/activity_pub/transmogrifier/chat_message_handling.ex

21 lines
551 B
Elixir
Raw Normal View History

2020-04-08 13:55:43 +00:00
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.ChatMessageHandling do
alias Pleroma.Web.ActivityPub.Pipeline
def handle_incoming(
%{"type" => "Create", "object" => %{"type" => "ChatMessage"}} = data,
2020-04-08 13:55:43 +00:00
_options
) do
case Pipeline.common_pipeline(data, local: false) do
{:ok, activity, _} ->
2020-04-28 15:29:54 +00:00
{:ok, activity}
e ->
2020-04-28 15:29:54 +00:00
e
2020-04-08 13:55:43 +00:00
end
end
end