summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/common_api.ex9
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/status_controller.ex2
-rw-r--r--lib/pleroma/workers/mute_expire_worker.ex2
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex
index cfb36bc1c..751260a46 100644
--- a/lib/pleroma/web/common_api.ex
+++ b/lib/pleroma/web/common_api.ex
@@ -572,16 +572,17 @@ defmodule Pleroma.Web.CommonAPI do
end
end
- @spec remove_mute(User.t(), Activity.t()) :: {:ok, Activity.t()} | {:error, any()}
- def remove_mute(%User{} = user, %Activity{} = activity) do
+ @spec remove_mute(Activity.t(), User.t()) :: {:ok, Activity.t()} | {:error, any()}
+ def remove_mute(%Activity{} = activity, %User{} = user) do
ThreadMute.remove_mute(user.id, activity.data["context"])
{:ok, activity}
end
- def remove_mute(user_id, activity_id) do
+ @spec remove_mute(String.t(), String.t()) :: {:ok, Activity.t()} | {:error, any()}
+ def remove_mute(activity_id, user_id) do
with {:user, %User{} = user} <- {:user, User.get_by_id(user_id)},
{:activity, %Activity{} = activity} <- {:activity, Activity.get_by_id(activity_id)} do
- remove_mute(user, activity)
+ remove_mute(activity, user)
else
{what, result} = error ->
Logger.warning(
diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
index f75efd00d..ab5a104dd 100644
--- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
@@ -467,7 +467,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
_
) do
with %Activity{} = activity <- Activity.get_by_id(id),
- {:ok, activity} <- CommonAPI.remove_mute(user, activity) do
+ {:ok, activity} <- CommonAPI.remove_mute(activity, user) do
try_render(conn, "show.json", activity: activity, for: user, as: :activity)
end
end
diff --git a/lib/pleroma/workers/mute_expire_worker.ex b/lib/pleroma/workers/mute_expire_worker.ex
index 8ad287a7f..a7ab5883a 100644
--- a/lib/pleroma/workers/mute_expire_worker.ex
+++ b/lib/pleroma/workers/mute_expire_worker.ex
@@ -14,7 +14,7 @@ defmodule Pleroma.Workers.MuteExpireWorker do
def perform(%Job{
args: %{"op" => "unmute_conversation", "user_id" => user_id, "activity_id" => activity_id}
}) do
- Pleroma.Web.CommonAPI.remove_mute(user_id, activity_id)
+ Pleroma.Web.CommonAPI.remove_mute(activity_id, user_id)
:ok
end