Pleroma.Object/1: take %Object{} as argument instead

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-12-28 10:33:28 +01:00
commit 18b536c176
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
9 changed files with 12 additions and 17 deletions

View file

@ -48,18 +48,12 @@ defmodule Pleroma.Activity.Ir.Topics do
tags
end
defp hashtags_to_topics(%{data: %{"hashtags" => tags}}) do
Enum.map(tags, fn tag -> "hashtag:" <> tag end)
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),