Add expires_in param for account mutes
This commit is contained in:
parent
d5c286b802
commit
c56e3d4f3b
9 changed files with 69 additions and 30 deletions
22
lib/pleroma/workers/mute_expire_worker.ex
Normal file
22
lib/pleroma/workers/mute_expire_worker.ex
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Workers.MuteExpireWorker do
|
||||
use Pleroma.Workers.WorkerHelper, queue: "mute_expire"
|
||||
|
||||
require Logger
|
||||
|
||||
@impl Oban.Worker
|
||||
def perform(%Job{args: %{"op" => "unmute", "muter" => muter_id, "mutee" => mutee_id}}) do
|
||||
muter = Pleroma.User.get_by_id(muter_id)
|
||||
mutee = Pleroma.User.get_by_id(mutee_id)
|
||||
Pleroma.User.unmute(muter, mutee)
|
||||
:ok
|
||||
end
|
||||
|
||||
def perform(any) do
|
||||
Logger.error("Got call to perform(#{inspect(any)})")
|
||||
:ok
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue