summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2020-04-27 17:41:38 +0300
committerrinpatch <rinpatch@sdf.org>2020-05-02 19:05:13 +0300
commit66a8e1312dc82fa755a635984f89a5314917d209 (patch)
tree3fc0c1647d954227604268d7dd94e8cdad16bf3c /lib
parente55876409b523d81bc19db876bc90f29ba80a47c (diff)
downloadpleroma-66a8e1312dc82fa755a635984f89a5314917d209.tar.gz
pleroma-66a8e1312dc82fa755a635984f89a5314917d209.zip
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')
-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 4618b4bbf..f9db97d24 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -43,8 +43,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, :follow_accept),
{:ok, _activity} <-