alias Pleroma.Web.MastodonAPI.{StatusView, AccountView, MastodonView, ListView}
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.Web.{CommonAPI, OStatus}
+ alias Pleroma.Web.CommonAPI
alias Pleroma.Web.OAuth.{Authorization, Token, App}
alias Comeonin.Pbkdf2
import Ecto.Query
fetched =
if Regex.match?(~r/https?:/, query) do
- with {:ok, activities} <- OStatus.fetch_activity_from_url(query) do
- activities
- |> Enum.filter(fn
- %{data: %{"type" => "Create"}} -> true
- _ -> false
- end)
+ with {:ok, object} <- ActivityPub.fetch_object_from_id(query) do
+ [Activity.get_create_activity_by_object_ap_id(object.data["id"])]
else
_e -> []
end
fetched =
if Regex.match?(~r/https?:/, query) do
- with {:ok, activities} <- OStatus.fetch_activity_from_url(query) do
- activities
- |> Enum.filter(fn
- %{data: %{"type" => "Create"}} -> true
- _ -> false
- end)
+ with {:ok, object} <- ActivityPub.fetch_object_from_id(query) do
+ [Activity.get_create_activity_by_object_ap_id(object.data["id"])]
else
_e -> []
end