2020-09-08 10:26:44 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 20:38:50 +00:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2020-09-08 10:26:44 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Workers.MuteExpireWorker do
|
2024-05-27 14:35:30 +00:00
|
|
|
use Pleroma.Workers.WorkerHelper, queue: "background"
|
2020-09-08 10:26:44 +00:00
|
|
|
|
|
|
|
@impl Oban.Worker
|
2020-09-08 12:13:50 +00:00
|
|
|
def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
|
2020-09-20 17:51:20 +00:00
|
|
|
Pleroma.User.unmute(muter_id, mutee_id)
|
2020-09-08 10:26:44 +00:00
|
|
|
:ok
|
|
|
|
end
|
|
|
|
|
2020-09-08 12:13:50 +00:00
|
|
|
def perform(%Job{
|
|
|
|
args: %{"op" => "unmute_conversation", "user_id" => user_id, "activity_id" => activity_id}
|
|
|
|
}) do
|
2020-09-20 17:51:20 +00:00
|
|
|
Pleroma.Web.CommonAPI.remove_mute(user_id, activity_id)
|
2020-09-08 10:26:44 +00:00
|
|
|
:ok
|
|
|
|
end
|
2022-11-11 18:42:29 +00:00
|
|
|
|
|
|
|
@impl Oban.Worker
|
|
|
|
def timeout(_job), do: :timer.seconds(5)
|
2020-09-08 10:26:44 +00:00
|
|
|
end
|