activitypub: transmogrifier: do not attempt to expand pre-existing AS2 tag objects
This commit is contained in:
parent
99f955cd9e
commit
94cbbb0e3a
@ -765,12 +765,18 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
def add_hashtags(object) do
|
def add_hashtags(object) do
|
||||||
tags =
|
tags =
|
||||||
(object["tag"] || [])
|
(object["tag"] || [])
|
||||||
|> Enum.map(fn tag ->
|
|> Enum.map(fn
|
||||||
%{
|
# Expand internal representation tags into AS2 tags.
|
||||||
"href" => Pleroma.Web.Endpoint.url() <> "/tags/#{tag}",
|
tag when is_binary(tag) ->
|
||||||
"name" => "##{tag}",
|
%{
|
||||||
"type" => "Hashtag"
|
"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)
|
end)
|
||||||
|
|
||||||
object
|
object
|
||||||
|
Loading…
Reference in New Issue
Block a user