Pipeline: Always run common_pipeline in a transaction for now.
[akkoma] / lib / pleroma / web / activity_pub / transmogrifier / chat_message_handling.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ActivityPub.Transmogrifier.ChatMessageHandling do
6 alias Pleroma.Web.ActivityPub.Pipeline
7
8 def handle_incoming(
9 %{"type" => "Create", "object" => %{"type" => "ChatMessage"}} = data,
10 _options
11 ) do
12 case Pipeline.common_pipeline(data, local: false) do
13 {:ok, activity, _} ->
14 {:ok, activity}
15
16 e ->
17 e
18 end
19 end
20 end