aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/common_api.ex
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2020-04-27 17:41:38 +0300
committerrinpatch <rinpatch@sdf.org>2020-05-01 00:39:23 +0300
commit78391a00c579696b1555bbe5373e128b932cfc3f (patch)
tree151a2744db29ccfc44b1f76b8af8714b871b5997 /lib/pleroma/web/common_api/common_api.ex
parent61889e00fc4a77e92ed7af3b6a270d10d5b2f34b (diff)
downloadpleroma-78391a00c579696b1555bbe5373e128b932cfc3f.tar.gz
Mastodon API: do not create a following relationship if the corresponding follow request doesn't exist when calling `POST /api/v1/follow_requests/:id/authorize`
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 091011c6b..511cae63f 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -39,8 +39,8 @@ defmodule Pleroma.Web.CommonAPI do
end
def accept_follow_request(follower, followed) do
- with {:ok, follower} <- User.follow(follower, followed),
- %Activity{} = follow_activity <- Utils.fetch_latest_follow(follower, followed),
+ with %Activity{} = follow_activity <- Utils.fetch_latest_follow(follower, followed),
+ {:ok, follower} <- User.follow(follower, followed),
{:ok, follow_activity} <- Utils.update_follow_state_for_all(follow_activity, "accept"),
{:ok, _relationship} <- FollowingRelationship.update(follower, followed, "accept"),
{:ok, _activity} <-