Create Object.hashtags/1 wrapper
This commit is contained in:
parent
acb03d591b
commit
87b13c5430
7 changed files with 20 additions and 20 deletions
|
|
@ -344,4 +344,8 @@ defmodule Pleroma.Object do
|
|||
|
||||
def self_replies(object, opts \\ []),
|
||||
do: replies(object, Keyword.put(opts, :self_only, true))
|
||||
|
||||
def hashtags(%{"hashtags" => hashtags}), do: hashtags || []
|
||||
def hashtags(%{"tag" => tags}), do: Enum.filter(tags, &is_bitstring(&1))
|
||||
def hashtags(_), do: []
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue