summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-08-07 13:59:01 -0400
committerMark Felder <feld@feld.me>2024-08-07 13:59:01 -0400
commit9e42c6b6a7c6c32ea88205536b657157d635ac2e (patch)
tree3f0a51d3d3790daee3562f669d83f9d8e1831e40 /lib
parent253178538410c63be6bd14016b800b42df59bfb6 (diff)
parent45611ed3255035845194d37cf1acd5d35f77a164 (diff)
downloadpleroma-9e42c6b6a7c6c32ea88205536b657157d635ac2e.tar.gz
pleroma-9e42c6b6a7c6c32ea88205536b657157d635ac2e.zip
Merge remote-tracking branch 'origin/develop' into inactive-test
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/common_api.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api.ex12
-rw-r--r--lib/pleroma/web/push.ex1
3 files changed, 8 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
diff --git a/lib/pleroma/web/push.ex b/lib/pleroma/web/push.ex
index d783f776a..6d777142e 100644
--- a/lib/pleroma/web/push.ex
+++ b/lib/pleroma/web/push.ex
@@ -29,5 +29,6 @@ defmodule Pleroma.Web.Push do
{:ok, Oban.Job.t()} | {:error, Oban.Job.changeset() | term()}
def send(notification) do
WebPusherWorker.new(%{"op" => "web_push", "notification_id" => notification.id})
+ |> Oban.insert()
end
end