Skip to content
Snippets Groups Projects
Commit ce4825c1 authored by rinpatch's avatar rinpatch :speech_balloon:
Browse files

Do not normalize objects in stream_out unless the activity type is

Create

Saves quite a bit of time with delete activities because they would
always query the db
parent 32a4501d
No related branches found
No related tags found
No related merge requests found
......@@ -168,7 +168,6 @@ def stream_out(activity) do
public = "https://www.w3.org/ns/activitystreams#Public"
if activity.data["type"] in ["Create", "Announce", "Delete"] do
object = Object.normalize(activity)
Pleroma.Web.Streamer.stream("user", activity)
Pleroma.Web.Streamer.stream("list", activity)
......@@ -180,6 +179,8 @@ def stream_out(activity) do
end
if activity.data["type"] in ["Create"] do
object = Object.normalize(activity)
object.data
|> Map.get("tag", [])
|> Enum.filter(fn tag -> is_bitstring(tag) end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment