Add idempotency_key to the chat_message entity.
[akkoma] / lib / pleroma / web / activity_pub / transmogrifier.ex
index 2f51f9e396ef1dc7ea52f8c76cf83be6197160ab..39c8f7e396ac064afc69d185613aaa28f59b53e5 100644 (file)
@@ -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.