From f3291acc9181dcc365aaca583ae3fb1ff57019d1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 26 Sep 2018 10:21:58 +0200 Subject: [PATCH] transmogrifier: pro-actively add support for Hashtag without array in tag --- lib/pleroma/web/activity_pub/transmogrifier.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index ed5df6f7b..291d7d169 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -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 -- 2.45.2