Disallow following locked accounts over OStatus

This commit is contained in:
rinpatch 2019-07-31 22:05:12 +03:00
commit 813c686dd7
2 changed files with 12 additions and 0 deletions

View file

@ -14,9 +14,13 @@ defmodule Pleroma.Web.OStatus.FollowHandler do
followed_uri when not is_nil(followed_uri) <-
XML.string_from_xpath("/entry/activity:object/id", entry),
{:ok, followed} <- OStatus.find_or_make_user(followed_uri),
{:locked, false} <- {:locked, followed.info.locked},
{:ok, activity} <- ActivityPub.follow(actor, followed, id, false) do
User.follow(actor, followed)
{:ok, activity}
else
{:locked, true} ->
{:error, "It's not possible to follow locked accounts over OStatus"}
end
end
end