summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/following_relationship.ex2
-rw-r--r--lib/pleroma/web/common_api.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/account_controller.ex2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/following_relationship.ex b/lib/pleroma/following_relationship.ex
index 3ec05da13..495488dfd 100644
--- a/lib/pleroma/following_relationship.ex
+++ b/lib/pleroma/following_relationship.ex
@@ -200,7 +200,7 @@ defmodule Pleroma.FollowingRelationship do
|> Repo.all()
|> Enum.map(fn following_relationship ->
Pleroma.Web.CommonAPI.follow(target, following_relationship.follower)
- Pleroma.Web.CommonAPI.unfollow(following_relationship.follower, origin)
+ Pleroma.Web.CommonAPI.unfollow(origin, following_relationship.follower)
end)
|> case do
[] ->
diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex
index 08bca4ffc..827710c11 100644
--- a/lib/pleroma/web/common_api.ex
+++ b/lib/pleroma/web/common_api.ex
@@ -136,7 +136,7 @@ defmodule Pleroma.Web.CommonAPI do
end
@spec unfollow(User.t(), User.t()) :: {:ok, User.t()} | {:error, any()}
- def unfollow(follower, unfollowed) do
+ def unfollow(unfollowed, follower) do
with {:ok, follower, _follow_activity} <- User.unfollow(follower, unfollowed),
{:ok, _activity} <- ActivityPub.unfollow(follower, unfollowed),
{:ok, _subscription} <- User.unsubscribe(follower, unfollowed),
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
index 00dc2e27c..80ab95a57 100644
--- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
@@ -460,7 +460,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
end
def unfollow(%{assigns: %{user: follower, account: followed}} = conn, _params) do
- with {:ok, follower} <- CommonAPI.unfollow(follower, followed) do
+ with {:ok, follower} <- CommonAPI.unfollow(followed, follower) do
render(conn, "relationship.json", user: follower, target: followed)
end
end