: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)
+ Pleroma.Web.Streamer.stream("user", activity)
+ if local do
+ Pleroma.Web.Streamer.stream("public:local", activity)
+ end
end
{:ok, activity}
end
end
defp restrict_favorited_by(query, _), do: query
- defp restrict_media(query, %{"only_media" => true}) do
+ defp restrict_media(query, %{"only_media" => val}) when val == "true" or val == "1" do
from activity in query,
where: fragment("not (? #> '{\"object\",\"attachment\"}' = ?)", activity.data, ^[])
end