MastoAPI: Basic streaming.
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 1624c6545b31e0af5fd1a7683431a3c1eb13a751..35536a1e41cb5530886a10fbb8a6ced31c873c97 100644 (file)
@@ -22,6 +22,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     with create_data <- make_create_data(%{to: to, actor: actor, published: published, context: context, object: object}, additional),
          {:ok, activity} <- insert(create_data, local),
          :ok <- maybe_federate(activity) do
+      if activity.data["type"] == "Create" and Enum.member?(activity.data["to"], "https://www.w3.org/ns/activitystreams#Public") do
+        Pleroma.Web.Streamer.stream("public", activity)
+      end
       {:ok, activity}
     end
   end