Pleroma.Object/1: take %Object{} as argument instead
This commit is contained in:
parent
87b13c5430
commit
18b536c176
9 changed files with 12 additions and 17 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue