From: lain Date: Fri, 29 May 2020 14:05:02 +0000 (+0200) Subject: SideEffects: Ensure a chat is present before streaming something out. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=3898dd69a69d3af9793f2e1d442b409c84b319a8;p=akkoma SideEffects: Ensure a chat is present before streaming something out. --- diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex index a4de8691e..02296b210 100644 --- a/lib/pleroma/web/activity_pub/side_effects.ex +++ b/lib/pleroma/web/activity_pub/side_effects.ex @@ -127,7 +127,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do def handle_object_creation(%{"type" => "ChatMessage"} = object, meta) do with {:ok, object, meta} <- Pipeline.common_pipeline(object, meta) do - Streamer.stream(["user", "user:pleroma_chat"], object) actor = User.get_cached_by_ap_id(object.data["actor"]) recipient = User.get_cached_by_ap_id(hd(object.data["to"])) @@ -142,6 +141,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do end end) + Streamer.stream(["user", "user:pleroma_chat"], object) {:ok, object, meta} end end