aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/common_api.ex
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-02-05 21:04:16 +0000
committerrinpatch <rinpatch@sdf.org>2020-02-05 21:04:16 +0000
commit15cb1f6804fde19330a3c1f06eb24802c7503be3 (patch)
treedbbf1cc80b1361080444d82e96c84113c10a2edd /lib/pleroma/web/common_api/common_api.ex
parent72d767998c389ea4c9896d8748b0529d134bd8a6 (diff)
parent50f5a920219d6637582a1998fd33ec4552e02e9c (diff)
downloadpleroma-15cb1f6804fde19330a3c1f06eb24802c7503be3.tar.gz
Merge branch 'fix/unpinnable-polls' into 'develop'
fix not being able to pin polls See merge request pleroma/pleroma!2172
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index c05a6c544..2a348dcf6 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -315,8 +315,9 @@ defmodule Pleroma.Web.CommonAPI do
with %Activity{
actor: ^user_ap_id,
data: %{"type" => "Create"},
- object: %Object{data: %{"type" => "Note"}}
+ 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),
{:ok, _user} <- User.add_pinnned_activity(user, activity) do
{:ok, activity}