Refactor mutes removing in CommonAPI and User
This commit is contained in:
parent
4987ee6256
commit
28d0986f83
5 changed files with 50 additions and 7 deletions
|
|
@ -7,18 +7,14 @@ defmodule Pleroma.Workers.MuteExpireWorker do
|
|||
|
||||
@impl Oban.Worker
|
||||
def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
|
||||
muter = Pleroma.User.get_by_id(muter_id)
|
||||
mutee = Pleroma.User.get_by_id(mutee_id)
|
||||
Pleroma.User.unmute(muter, mutee)
|
||||
Pleroma.User.unmute(muter_id, mutee_id)
|
||||
:ok
|
||||
end
|
||||
|
||||
def perform(%Job{
|
||||
args: %{"op" => "unmute_conversation", "user_id" => user_id, "activity_id" => activity_id}
|
||||
}) do
|
||||
user = Pleroma.User.get_by_id(user_id)
|
||||
activity = Pleroma.Activity.get_by_id(activity_id)
|
||||
Pleroma.Web.CommonAPI.remove_mute(user, activity)
|
||||
Pleroma.Web.CommonAPI.remove_mute(user_id, activity_id)
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue