Fix CommonAPI.vote returning tuples inside of the activity array instead of just activities

This commit is contained in:
rinpatch 2019-06-04 13:38:24 +03:00
parent 29b022bb59
commit 17383861ed

View File

@ -132,6 +132,7 @@ defmodule Pleroma.Web.CommonAPI do
Enum.map(choices, fn index -> Enum.map(choices, fn index ->
answer_data = make_answer_data(user, object, Enum.at(options, index)["name"]) answer_data = make_answer_data(user, object, Enum.at(options, index)["name"])
{:ok, activity} =
ActivityPub.create(%{ ActivityPub.create(%{
to: answer_data["to"], to: answer_data["to"],
actor: user, actor: user,
@ -139,6 +140,8 @@ defmodule Pleroma.Web.CommonAPI do
object: answer_data, object: answer_data,
additional: %{"cc" => answer_data["cc"]} additional: %{"cc" => answer_data["cc"]}
}) })
activity
end) end)
object = Object.get_cached_by_ap_id(object.data["id"]) object = Object.get_cached_by_ap_id(object.data["id"])