X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fmastodon_api.ex;h=8b137891791fe96927ad78e64b0aad7bded08bdc;hb=106f4e7a0fd70ab04a116238af0322e991cc88c6;hp=9d1fb22ea467a2f38ce43e13846e23e40ae244ce;hpb=132d815f1f749cec4b54083fc46046c45e7d0d04;p=akkoma diff --git a/lib/pleroma/web/mastodon_api/mastodon_api.ex b/lib/pleroma/web/mastodon_api/mastodon_api.ex index 9d1fb22ea..8b1378917 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api.ex @@ -1,20 +1 @@ -# Pleroma: A lightweight social networking server -# Copyright _ 2017-2019 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.Web.MastodonAPI do - alias Pleroma.{Repo, Activity, Object, HTML} - alias Pleroma.Web.ActivityPub.ActivityPub - - def get_status_card(status_id) do - with %Activity{} = activity <- Repo.get(Activity, status_id), - true <- ActivityPub.is_public?(activity), - %Object{} = object <- Object.normalize(activity.data["object"]), - page_url <- HTML.extract_first_external_url(object, object.data["content"]), - {:ok, rich_media} <- Pleroma.Web.RichMedia.Parser.parse(page_url) do - %{page_url: page_url, rich_media: rich_media} - else - _ -> %{} - end - end -end