From 4bab9fb44649bb590e2881fdecd52031692d8755 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 15 Jan 2026 15:39:46 -0500 Subject: [PATCH] fix: export sendMessage as _sendMessage for use in ap jobs lib --- src/activitypub/index.js | 6 +++--- src/activitypub/jobs.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index d60ddb144b..ff028c4888 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -355,7 +355,7 @@ ActivityPub.get = async (type, id, uri, options) => { } }; -async function sendMessage(uri, id, type, payload) { +ActivityPub._sendMessage = async function (uri, id, type, payload) { try { const keyData = await ActivityPub.getPrivateKey(type, id); const headers = await ActivityPub.sign(keyData, uri, payload); @@ -381,7 +381,7 @@ async function sendMessage(uri, id, type, payload) { ActivityPub.helpers.log(`[activitypub/send] Could not send ${payload.type} to ${uri}; error: ${e.message}`); return false; } -} +}; ActivityPub.send = async (type, id, targets, payload) => { if (!meta.config.activitypubEnabled) { @@ -415,7 +415,7 @@ ActivityPub.send = async (type, id, targets, payload) => { const retryQueuedSet = []; await Promise.all(inboxBatch.map(async (uri) => { - const ok = await sendMessage(uri, id, type, payload); + const ok = await ActivityPub._sendMessage(uri, id, type, payload); if (!ok) { const queueId = crypto.createHash('sha256').update(`${type}:${id}:${uri}`).digest('hex'); const nextTryOn = Date.now() + oneMinute; diff --git a/src/activitypub/jobs.js b/src/activitypub/jobs.js index 399e92bb85..1ba0dd57ce 100644 --- a/src/activitypub/jobs.js +++ b/src/activitypub/jobs.js @@ -65,7 +65,7 @@ async function retryFailedMessages() { queueIdsToRemove.push(queueId); return; } - const ok = await sendMessage(uri, id, type, payloadObj); + const ok = await activitypub._sendMessage(uri, id, type, payloadObj); if (ok) { queueIdsToRemove.push(queueId); } else {