# Client API
- def incoming_doc(doc) do
- ReceiverWorker.enqueue("incoming_doc", %{"body" => doc})
- end
-
def incoming_ap_doc(params) do
ReceiverWorker.enqueue("incoming_ap_doc", %{"params" => params})
end
end
end
- def perform(:incoming_doc, doc) do
- Logger.info("Got document, trying to parse")
- OStatus.handle_incoming(doc)
- end
-
def perform(:incoming_ap_doc, params) do
Logger.info("Handling incoming AP activity")
use Pleroma.Workers.WorkerHelper, queue: "federator_incoming"
@impl Oban.Worker
- def perform(%{"op" => "incoming_doc", "body" => doc}, _job) do
- Federator.perform(:incoming_doc, doc)
- end
-
def perform(%{"op" => "incoming_ap_doc", "params" => params}, _job) do
Federator.perform(:incoming_ap_doc, params)
end