Federate correct activity
[akkoma] / lib / pleroma / web / ostatus / activity_representer.ex
index 921a89bd015fca545652f3c0f202996e0d220080..1e9d4a7fbb354ed7f7c93d55a791d3fd0cd18a91 100644 (file)
@@ -240,7 +240,13 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
     inserted_at = activity.data["published"]
 
     author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
-    follow_activity = Activity.get_by_ap_id(activity.data["object"])
+
+    follow_activity =
+      if is_map(activity.data["object"]) do
+        Activity.get_by_ap_id(activity.data["object"]["id"])
+      else
+        Activity.get_by_ap_id(activity.data["object"])
+      end
 
     mentions = (activity.recipients || []) |> get_mentions