logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

mute_expire_worker.ex (718B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Workers.MuteExpireWorker do
  5. use Pleroma.Workers.WorkerHelper, queue: "mute_expire"
  6. @impl Oban.Worker
  7. def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
  8. Pleroma.User.unmute(muter_id, mutee_id)
  9. :ok
  10. end
  11. def perform(%Job{
  12. args: %{"op" => "unmute_conversation", "user_id" => user_id, "activity_id" => activity_id}
  13. }) do
  14. Pleroma.Web.CommonAPI.remove_mute(user_id, activity_id)
  15. :ok
  16. end
  17. @impl Oban.Worker
  18. def timeout(_job), do: :timer.seconds(5)
  19. end