fix not being able to pin polls

This commit is contained in:
rinpatch 2020-02-02 14:55:06 +03:00
parent 1e74bbc495
commit 31dc669de6

View file

@ -328,15 +328,10 @@ def update(user) do
def pin(id_or_ap_id, %{ap_id: user_ap_id} = user) do def pin(id_or_ap_id, %{ap_id: user_ap_id} = user) do
with %Activity{ with %Activity{
actor: ^user_ap_id, actor: ^user_ap_id,
data: %{ data: %{"type" => "Create"},
"type" => "Create" object: %Object{data: %{"type" => object_type}}
},
object: %Object{
data: %{
"type" => "Note"
}
}
} = activity <- get_by_id_or_ap_id(id_or_ap_id), } = activity <- get_by_id_or_ap_id(id_or_ap_id),
true <- object_type in ["Note", "Article", "Question"],
true <- Visibility.is_public?(activity), true <- Visibility.is_public?(activity),
%{valid?: true} = info_changeset <- User.Info.add_pinnned_activity(user.info, activity), %{valid?: true} = info_changeset <- User.Info.add_pinnned_activity(user.info, activity),
changeset <- changeset <-