diff options
author | lain <lain@soykaf.club> | 2020-10-19 15:46:24 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-10-19 15:46:24 +0200 |
commit | e97b254c6bb798d200f381e5adbde2177bcbc0df (patch) | |
tree | a1e5790a784c89afea1a7a1c29529127102ed88c /lib | |
parent | 39fd4d7639a0ab47bc5ae3839b10701fc301a1be (diff) | |
download | pleroma-e97b254c6bb798d200f381e5adbde2177bcbc0df.tar.gz |
Transmogrifier: Refactor and unify incoming tag handling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 2f51f9e39..39c8f7e39 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -323,14 +323,12 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do Map.put(object, "tag", tag ++ tags) end - def fix_tag(%{"tag" => %{"type" => "Hashtag", "name" => hashtag} = tag} = object) do - combined = [tag, String.slice(hashtag, 1..-1)] - - Map.put(object, "tag", combined) + def fix_tag(%{"tag" => %{} = tag} = object) do + object + |> Map.put("tag", [tag]) + |> fix_tag end - def fix_tag(%{"tag" => %{} = tag} = object), do: Map.put(object, "tag", [tag]) - def fix_tag(object), do: object # content map usually only has one language so this will do for now. |