# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push do
- alias Pleroma.Web.Push.Impl
+ alias Pleroma.Repo
+ alias Pleroma.Workers.WebPusherWorker
require Logger
+ import Pleroma.Workers.WorkerHelper, only: [worker_args: 1]
+
def init do
unless enabled() do
Logger.warn("""
end
end
- def send(notification),
- do: PleromaJobQueue.enqueue(:web_push, Impl, [notification])
+ def send(notification) do
+ %{"op" => "web_push", "notification_id" => notification.id}
+ |> WebPusherWorker.new(worker_args(:web_push))
+ |> Repo.insert()
+ end
end