[MastodonAPI] the tag field isn’t fixed to a static type in pleroma
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 7 Aug 2018 21:49:35 +0000 (23:49 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 27 Aug 2018 13:08:25 +0000 (15:08 +0200)
lib/pleroma/web/activity_pub/activity_pub.ex

index 749ffbcd48bda62ac3320b54561b67bd05b7f302..ed22405306e6ce700b9333f172a187b5213d9c28 100644 (file)
@@ -84,7 +84,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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