X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fo_status%2Fo_status_controller.ex;h=da3264149b792c644266659ab063d70910a465d5;hb=0ada3fe823a3c2e6c5835431bdacfbdb8b3d02a7;hp=668ae0ea4fde363ba01e4eb24f92380d4e61ae76;hpb=24ce3249736c96686c00a10abe47659579535259;p=akkoma
diff --git a/lib/pleroma/web/o_status/o_status_controller.ex b/lib/pleroma/web/o_status/o_status_controller.ex
index 668ae0ea4..da3264149 100644
--- a/lib/pleroma/web/o_status/o_status_controller.ex
+++ b/lib/pleroma/web/o_status/o_status_controller.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.OStatus.OStatusController do
@@ -73,15 +73,11 @@ defmodule Pleroma.Web.OStatus.OStatusController do
%User{} = user <- User.get_cached_by_ap_id(activity.data["actor"]) do
cond do
format in ["json", "activity+json"] ->
- if activity.local do
- %{data: %{"id" => redirect_url}} = Object.normalize(activity)
- redirect(conn, external: redirect_url)
- else
- {:error, :not_found}
- end
+ %{data: %{"id" => redirect_url}} = Object.normalize(activity, fetch: false)
+ redirect(conn, external: redirect_url)
activity.data["type"] == "Create" ->
- %Object{} = object = Object.normalize(activity)
+ %Object{} = object = Object.normalize(activity, fetch: false)
RedirectController.redirector_with_meta(
conn,
@@ -112,7 +108,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
with %Activity{data: %{"type" => "Create"}} = activity <- Activity.get_by_id_with_object(id),
true <- Visibility.is_public?(activity),
{_, true} <- {:visible?, Visibility.visible_for_user?(activity, _reading_user = nil)},
- %Object{} = object <- Object.normalize(activity),
+ %Object{} = object <- Object.normalize(activity, fetch: false),
%{data: %{"attachment" => [%{"url" => [url | _]} | _]}} <- object,
true <- String.starts_with?(url["mediaType"], ["audio", "video"]) do
conn