1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Workers.SubscriberWorker do
7 alias Pleroma.Web.Federator
8 alias Pleroma.Web.Websub
10 use Pleroma.Workers.WorkerHelper, queue: "federator_outgoing"
13 def perform(%{"op" => "refresh_subscriptions"}, _job) do
14 Federator.perform(:refresh_subscriptions)
17 def perform(%{"op" => "request_subscription", "websub_id" => websub_id}, _job) do
18 websub = Repo.get(Websub.WebsubClientSubscription, websub_id)
19 Federator.perform(:request_subscription, websub)
22 def perform(%{"op" => "verify_websub", "websub_id" => websub_id}, _job) do
23 websub = Repo.get(Websub.WebsubServerSubscription, websub_id)
24 Federator.perform(:verify_websub, websub)