ostatus: use Activity.normalize() instead of directly using Activity.get_by_ap_id().
This commit is contained in:
parent
5b240c3b18
commit
6f4ca7ddf7
@ -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']},
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user