diff options
author | feld <feld@feld.me> | 2024-08-07 17:00:16 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2024-08-07 17:00:16 +0000 |
commit | c81c663db3c02f4c2e2707be2e5f307bd7c80689 (patch) | |
tree | 2b97f801a86c8a3f46d6863c4cfc37104ae234f9 /lib | |
parent | 351a306d462ae804ee9d0bbc9f8e7781caf34533 (diff) | |
parent | 06e8ece4cc3956d991d48dbd338604b7940d167c (diff) | |
download | pleroma-c81c663db3c02f4c2e2707be2e5f307bd7c80689.tar.gz pleroma-c81c663db3c02f4c2e2707be2e5f307bd7c80689.zip |
Merge branch 'commonapi-consistency' into 'develop'
Fix CommonAPI.follow/2 return values order
See merge request pleroma/pleroma!4209
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/common_api.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api.ex | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex index 1ed905d6c..921e414c3 100644 --- a/lib/pleroma/web/common_api.ex +++ b/lib/pleroma/web/common_api.ex @@ -130,7 +130,7 @@ defmodule Pleroma.Web.CommonAPI do if activity.data["state"] == "reject" do {:error, :rejected} else - {:ok, follower, followed, activity} + {:ok, followed, follower, activity} end end end diff --git a/lib/pleroma/web/mastodon_api/mastodon_api.ex b/lib/pleroma/web/mastodon_api/mastodon_api.ex index 6dcbfb097..c9e045d23 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api.ex @@ -18,10 +18,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do if not User.following?(follower, followed) do CommonAPI.follow(followed, follower) else - {:ok, follower, followed, nil} + {:ok, followed, follower, nil} end - with {:ok, follower, _followed, _} <- result do + with {:ok, _followed, follower, _} <- result do options = cast_params(params) set_reblogs_visibility(options[:reblogs], result) set_subscription(options[:notify], result) @@ -29,19 +29,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do end end - defp set_reblogs_visibility(false, {:ok, follower, followed, _}) do + defp set_reblogs_visibility(false, {:ok, followed, follower, _}) do CommonAPI.hide_reblogs(followed, follower) end - defp set_reblogs_visibility(_, {:ok, follower, followed, _}) do + defp set_reblogs_visibility(_, {:ok, followed, follower, _}) do CommonAPI.show_reblogs(followed, follower) end - defp set_subscription(true, {:ok, follower, followed, _}) do + defp set_subscription(true, {:ok, followed, follower, _}) do User.subscribe(follower, followed) end - defp set_subscription(false, {:ok, follower, followed, _}) do + defp set_subscription(false, {:ok, followed, follower, _}) do User.unsubscribe(follower, followed) end |