diff options
author | rinpatch <rinpatch@sdf.org> | 2020-02-02 14:55:06 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-02-09 01:05:07 +0300 |
commit | 31dc669de6ae73dba395abf4380c427fdb10f7d8 (patch) | |
tree | 3db540be062f7294211d7cea83ede5c45706b243 | |
parent | 1e74bbc4950768fa9af027034c46380487b336c0 (diff) | |
download | pleroma-31dc669de6ae73dba395abf4380c427fdb10f7d8.tar.gz |
fix not being able to pin polls
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 184ec6021..01ed7b16f 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -328,15 +328,10 @@ defmodule Pleroma.Web.CommonAPI do def pin(id_or_ap_id, %{ap_id: user_ap_id} = user) do with %Activity{ actor: ^user_ap_id, - data: %{ - "type" => "Create" - }, - object: %Object{ - data: %{ - "type" => "Note" - } - } + data: %{"type" => "Create"}, + object: %Object{data: %{"type" => object_type}} } = activity <- get_by_id_or_ap_id(id_or_ap_id), + true <- object_type in ["Note", "Article", "Question"], true <- Visibility.is_public?(activity), %{valid?: true} = info_changeset <- User.Info.add_pinnned_activity(user.info, activity), changeset <- |