mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 16:16:34 +00:00
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
This commit is contained in:
parent
32a4501d2d
commit
ce4825c1dc
1 changed files with 2 additions and 1 deletions
|
@ -168,7 +168,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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)
|
||||
|
|
Loading…
Reference in a new issue