Replace Object.normalize(activity.data[object] with Object.normalize(acitivty) to...
authorrinpatch <rinpatch@sdf.org>
Mon, 22 Apr 2019 08:27:29 +0000 (11:27 +0300)
committerrinpatch <rinpatch@sdf.org>
Mon, 22 Apr 2019 08:27:29 +0000 (11:27 +0300)
lib/pleroma/gopher/server.ex
lib/pleroma/object/fetcher.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/common_api/utils.ex
lib/pleroma/web/mastodon_api/views/status_view.ex
lib/pleroma/web/ostatus/activity_representer.ex

index 2ebc5d5f7a8ebc306d34904f2c97b4f2a2a95ff4..1d2e0785c4e8d8c44f752c3cab572e440a349d4c 100644 (file)
@@ -76,7 +76,7 @@ defmodule Pleroma.Gopher.Server.ProtocolHandler do
     |> Enum.map(fn activity ->
       user = User.get_cached_by_ap_id(activity.data["actor"])
 
-      object = Object.normalize(activity.data["object"])
+      object = Object.normalize(activity)
       like_count = object["like_count"] || 0
       announcement_count = object["announcement_count"] || 0
 
index 138e7866f4c2ec494982ce73f13b1d1952f72b9b..8d4bcc95efa7771ad48fcb4a424258b93eaac4ec 100644 (file)
@@ -39,7 +39,7 @@ defmodule Pleroma.Object.Fetcher do
           Logger.info("Couldn't get object via AP, trying out OStatus fetching...")
 
           case OStatus.fetch_activity_from_url(id) do
-            {:ok, [activity | _]} -> {:ok, Object.normalize(activity.data["object"], false)}
+            {:ok, [activity | _]} -> {:ok, Object.normalize(activity, false)}
             e -> e
           end
       end
index 48f05c1f91f26e83d8a72ab1a93221ad64028dce..604ffae7b4e50df0d525e94c0f7dbda0711d217c 100644 (file)
@@ -168,7 +168,7 @@ 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.data["object"])
+      object = Object.normalize(activity)
       Pleroma.Web.Streamer.stream("user", activity)
       Pleroma.Web.Streamer.stream("list", activity)
 
index 0852896d0c33145e0ab615361486d9bc719adcf9..887f878c440ed2a6e6550017596c3f3764d1db12 100644 (file)
@@ -226,7 +226,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
     }
 
     if in_reply_to do
-      in_reply_to_object = Object.normalize(in_reply_to.data["object"])
+      in_reply_to_object = Object.normalize(in_reply_to)
 
       object
       |> Map.put("inReplyTo", in_reply_to_object.data["id"])
index 17c33080bb55fed51f309201d454e20b78a5bc70..58c6871d1e4f2d11e8489f6554cf01da972eb54b 100644 (file)
@@ -31,7 +31,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     |> Activity.create_by_object_ap_id()
     |> Repo.all()
     |> Enum.reduce(%{}, fn activity, acc ->
-      object = Object.normalize(activity.data["object"])
+      object = Object.normalize(activity)
       Map.put(acc, object.data["id"], activity)
     end)
   end
@@ -316,7 +316,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
   end
 
   def get_reply_to(activity, %{replied_to_activities: replied_to_activities}) do
-    object = Object.normalize(activity.data["object"])
+    object = Object.normalize(activity)
 
     with nil <- replied_to_activities[object.data["inReplyTo"]] do
       # If user didn't participate in the thread
index b11a2b5ce3e31bd3431f63b2db972559de918a48..166691a0980230cd630d5cedc92e44e97a391738 100644 (file)
@@ -84,7 +84,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
   def to_simple_form(%{data: %{"type" => "Create"}} = activity, user, with_author) do
     h = fn str -> [to_charlist(str)] end
 
-    object = Object.normalize(activity.data["object"])
+    object = Object.normalize(activity)
 
     updated_at = object.data["published"]
     inserted_at = object.data["published"]