forked from AkkomaGang/akkoma
SideEffects: Ensure a chat is present before streaming something out.
This commit is contained in:
parent
b08baf905b
commit
3898dd69a6
1 changed files with 1 additions and 1 deletions
|
@ -127,7 +127,6 @@ def handle(object, meta) do
|
||||||
|
|
||||||
def handle_object_creation(%{"type" => "ChatMessage"} = object, meta) do
|
def handle_object_creation(%{"type" => "ChatMessage"} = object, meta) do
|
||||||
with {:ok, object, meta} <- Pipeline.common_pipeline(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"])
|
actor = User.get_cached_by_ap_id(object.data["actor"])
|
||||||
recipient = User.get_cached_by_ap_id(hd(object.data["to"]))
|
recipient = User.get_cached_by_ap_id(hd(object.data["to"]))
|
||||||
|
|
||||||
|
@ -142,6 +141,7 @@ def handle_object_creation(%{"type" => "ChatMessage"} = object, meta) do
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Streamer.stream(["user", "user:pleroma_chat"], object)
|
||||||
{:ok, object, meta}
|
{:ok, object, meta}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue