projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Polls: Persist and show voters' count
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
activity_pub.ex
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index d403405a0d3547139a0e97af5cd0474254e3e963..4a133498e974ddb10a59beea9db8189109ce7584 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-118,9
+118,10
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
def increase_poll_votes_if_vote(%{
"object" => %{"inReplyTo" => reply_ap_id, "name" => name},
def increase_poll_votes_if_vote(%{
"object" => %{"inReplyTo" => reply_ap_id, "name" => name},
- "type" => "Create"
+ "type" => "Create",
+ "actor" => actor
}) do
}) 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
end
def increase_poll_votes_if_vote(_create_data), do: :noop
@@
-1430,7
+1431,10
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
emojis =
data
|> Map.get("tag", [])
emojis =
data
|> Map.get("tag", [])
- |> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
+ |> Enum.filter(fn
+ %{"type" => "Emoji"} -> true
+ _ -> false
+ end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
Map.put(acc, String.trim(name, ":"), url)
end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
Map.put(acc, String.trim(name, ":"), url)
end)