Browse Source

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

tags/v1.1.4
William Pitcock 5 years ago
parent
commit
94cbbb0e3a
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      lib/pleroma/web/activity_pub/transmogrifier.ex

+ 12
- 6
lib/pleroma/web/activity_pub/transmogrifier.ex 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


Loading…
Cancel
Save