Merge branch 'features/hashtag-column' into 'develop'

Insert text representation of hashtags into object["hashtags"]

See merge request pleroma/pleroma!2824
This commit is contained in:
Haelwenn 2020-12-28 10:14:58 +00:00
commit b122b6ffa3
24 changed files with 163 additions and 70 deletions

View file

@ -346,4 +346,8 @@ defmodule Pleroma.Object do
def self_replies(object, opts \\ []),
do: replies(object, Keyword.put(opts, :self_only, true))
def hashtags(%Object{data: %{"hashtags" => hashtags}}), do: hashtags || []
def hashtags(%Object{data: %{"tag" => tags}}), do: Enum.filter(tags, &is_bitstring(&1))
def hashtags(_), do: []
end