diff options
author | rinpatch <rinpatch@sdf.org> | 2019-04-30 20:21:28 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-04-30 20:21:28 +0300 |
commit | ce4825c1dc8a2b7ec2712170f45cde0ae14b46cf (patch) | |
tree | 4a0ba8782a0048f322f5528d120b35588d4c1480 /lib | |
parent | 32a4501d2d1cdfef68cbde236482e0c84cce3a7a (diff) | |
download | pleroma-ce4825c1dc8a2b7ec2712170f45cde0ae14b46cf.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 604ffae7b..483a2153f 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -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) |