transmogrifier: pro-actively add support for Hashtag without array in tag

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-09-26 10:21:58 +02:00
parent 2c820e10b8
commit f3291acc91
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE

View File

@ -206,6 +206,13 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|> Map.put("tag", combined)
end
def fix_tag(%{"tag" => %{"type" => "Hashtag"} = tag} = object) do
combined = [tag ++ String.slice(tag["name"], 1..-1)]
object
|> Map.put("tag", combined)
end
def fix_tag(object) do
object
end