[MastodonAPI] the tag field isn’t fixed to a static type in pleroma

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-07 23:49:35 +02:00
parent 83efaa3af6
commit 97e20d2932
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE

View File

@ -84,7 +84,9 @@ def stream_out(activity) do
Pleroma.Web.Streamer.stream("public:local", activity)
end
activity.data["object"]["tag"]
activity.data["object"]
|> Map.get("tag", [])
|> Enum.filter(fn tag -> is_bitstring(tag) end)
|> Enum.map(fn tag -> Pleroma.Web.Streamer.stream("hashtag:" <> tag, activity) end)
if activity.data["object"]["attachment"] != [] do