Pleroma.Object/1: take %Object{} as argument instead
[akkoma] / lib / pleroma / activity / ir / topics.ex
index fe2e8cb5c900d7b84f0e92bc1ba42a74c85d685b..b7553c72857a70549ee61e910ddd4d1d33b3cea4 100644 (file)
@@ -48,14 +48,12 @@ defmodule Pleroma.Activity.Ir.Topics do
     tags
   end
 
-  defp hashtags_to_topics(%{data: %{"tag" => tags}}) do
-    tags
-    |> Enum.filter(&is_bitstring(&1))
+  defp hashtags_to_topics(object) do
+    object
+    |> Object.hashtags()
     |> Enum.map(fn tag -> "hashtag:" <> tag end)
   end
 
-  defp hashtags_to_topics(_), do: []
-
   defp remote_topics(%{local: true}), do: []
 
   defp remote_topics(%{actor: actor}) when is_binary(actor),