ostatus: use Activity.normalize() instead of directly using Activity.get_by_ap_id().
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 18 Jun 2018 21:20:44 +0000 (21:20 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 27 Jun 2018 13:08:05 +0000 (13:08 +0000)
lib/pleroma/web/ostatus/activity_representer.ex
lib/pleroma/web/ostatus/ostatus_controller.ex

index 4179d86c9b354adb1501c5de6d3cae3a6a805183..5d831459b9e247e546573d496b43cbf8277321d4 100644 (file)
@@ -246,7 +246,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
     author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
 
     mentions = (activity.recipients || []) |> get_mentions
-    follow_activity = Activity.get_by_ap_id(follow_activity["id"])
+    follow_activity = Activity.normalize(follow_activity)
 
     [
       {:"activity:object-type", ['http://activitystrea.ms/schema/1.0/activity']},
index 2f72fdb16ce8fd9b822d78dd24373f5bf1aa25aa..00bffbd5da253f2b74ed5cbb82c26045a0f1a469 100644 (file)
@@ -107,7 +107,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
 
   def activity(conn, %{"uuid" => uuid}) do
     with id <- o_status_url(conn, :activity, uuid),
-         {_, %Activity{} = activity} <- {:activity, Activity.get_by_ap_id(id)},
+         {_, %Activity{} = activity} <- {:activity, Activity.normalize(id)},
          {_, true} <- {:public?, ActivityPub.is_public?(activity)},
          %User{} = user <- User.get_cached_by_ap_id(activity.data["actor"]) do
       case get_format(conn) do