1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2024-12-26 08:55:18 +01:00

activitypub: transmogrifier: do not attempt to expand pre-existing AS2 tag objects

This commit is contained in:
William Pitcock 2019-02-14 00:27:35 +00:00
parent 99f955cd9e
commit 94cbbb0e3a

View File

@ -765,12 +765,18 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def add_hashtags(object) do
tags =
(object["tag"] || [])
|> Enum.map(fn tag ->
%{
"href" => Pleroma.Web.Endpoint.url() <> "/tags/#{tag}",
"name" => "##{tag}",
"type" => "Hashtag"
}
|> Enum.map(fn
# Expand internal representation tags into AS2 tags.
tag when is_binary(tag) ->
%{
"href" => Pleroma.Web.Endpoint.url() <> "/tags/#{tag}",
"name" => "##{tag}",
"type" => "Hashtag"
}
# Do not process tags which are already AS2 tag objects.
tag when is_map(tag) ->
tag
end)
object