Add expiring blocks
- `/api/v1/accounts/:id/block` now has a "duration" parameter - `/api/v1/blocks` returns "block_expires_at" to indicate when the block will expire - MuteExpireWorker also processes block expiration - Remove unused OpenAPI parameters from mute endpoint - Add pleroma:block_expiration to nodeinfo features
This commit is contained in:
parent
1775a4db08
commit
51a0cee405
12 changed files with 112 additions and 33 deletions
|
|
@ -5,9 +5,13 @@
|
|||
defmodule Pleroma.Workers.MuteExpireWorker do
|
||||
use Oban.Worker, queue: :background
|
||||
|
||||
alias Pleroma.User
|
||||
|
||||
@impl true
|
||||
def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
|
||||
Pleroma.User.unmute(muter_id, mutee_id)
|
||||
def perform(%Job{
|
||||
args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}
|
||||
}) do
|
||||
User.unmute(muter_id, mutee_id)
|
||||
:ok
|
||||
end
|
||||
|
||||
|
|
@ -18,6 +22,17 @@ defmodule Pleroma.Workers.MuteExpireWorker do
|
|||
:ok
|
||||
end
|
||||
|
||||
def perform(%Job{
|
||||
args: %{"op" => "unblock_user", "blocker_id" => blocker_id, "blocked_id" => blocked_id}
|
||||
}) do
|
||||
Pleroma.Web.CommonAPI.unblock(
|
||||
User.get_cached_by_id(blocked_id),
|
||||
User.get_cached_by_id(blocker_id)
|
||||
)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
@impl true
|
||||
def timeout(_job), do: :timer.seconds(5)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue