akkoma/lib/pleroma/workers/mute_expire_worker.ex

21 lines
654 B
Elixir
Raw Permalink Normal View History

2020-09-08 04:26:44 -06:00
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
2020-09-08 04:26:44 -06:00
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.MuteExpireWorker do
use Pleroma.Workers.WorkerHelper, queue: "mute_expire"
@impl Oban.Worker
2020-09-08 06:13:50 -06:00
def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
Pleroma.User.unmute(muter_id, mutee_id)
2020-09-08 04:26:44 -06:00
:ok
end
2020-09-08 06:13:50 -06:00
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)
2020-09-08 04:26:44 -06:00
:ok
end
end