Polls: Persist and show voters' count
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index cb942c2117194007644cfeae89ce252e9afe3aea..4a133498e974ddb10a59beea9db8189109ce7584 100644 (file)
@@ -118,9 +118,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
   def increase_poll_votes_if_vote(%{
         "object" => %{"inReplyTo" => reply_ap_id, "name" => name},
-        "type" => "Create"
+        "type" => "Create",
+        "actor" => actor
       }) do
-    Object.increase_vote_count(reply_ap_id, name)
+    Object.increase_vote_count(reply_ap_id, name, actor)
   end
 
   def increase_poll_votes_if_vote(_create_data), do: :noop
@@ -1431,7 +1432,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       data
       |> Map.get("tag", [])
       |> Enum.filter(fn
-        %{"type" => t} -> t == "Emoji"
+        %{"type" => "Emoji"} -> true
         _ -> false
       end)
       |> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->