From 4cdfcf95e6cd3ab7ae0aea4f24c0d5474791c203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 28 Mar 2025 16:06:38 -0400 Subject: [PATCH] lint: fix tabs --- src/api/activitypub.js | 49 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/api/activitypub.js b/src/api/activitypub.js index 6f0fcd28e9..a6ba295b06 100644 --- a/src/api/activitypub.js +++ b/src/api/activitypub.js @@ -387,33 +387,34 @@ activitypubApi.flag = enabledCheck(async (caller, flag) => { await db.sortedSetAdd(`flag:${flag.flagId}:remote`, Date.now(), caller.uid); }); -// activitypubApi.add = enabledCheck((async (_, { pid }) => { -// let localId; -// if (String(pid).startsWith(nconf.get('url'))) { -// ({ id: localId } = await activitypub.helpers.resolveLocalId(pid)); -// } +/* +activitypubApi.add = enabledCheck((async (_, { pid }) => { + let localId; + if (String(pid).startsWith(nconf.get('url'))) { + ({ id: localId } = await activitypub.helpers.resolveLocalId(pid)); + } -// const tid = await posts.getPostField(localId || pid, 'tid'); -// const cid = await posts.getCidByPid(localId || pid); -// if (!utils.isNumber(tid) || cid <= 0) { // `Add` only federated on categorized topics started locally -// return; -// } + const tid = await posts.getPostField(localId || pid, 'tid'); + const cid = await posts.getCidByPid(localId || pid); + if (!utils.isNumber(tid) || cid <= 0) { // `Add` only federated on categorized topics started locally + return; + } -// let to = [activitypub._constants.publicAddress]; -// let cc = []; -// let targets; -// ({ to, cc, targets } = await activitypub.buildRecipients({ to, cc }, { pid: localId || pid, cid })); - -// await activitypub.send('cid', cid, Array.from(targets), { -// id: `${nconf.get('url')}/post/${encodeURIComponent(localId || pid)}#activity/add/${Date.now()}`, -// type: 'Add', -// to, -// cc, -// object: utils.isNumber(pid) ? `${nconf.get('url')}/post/${pid}` : pid, -// target: `${nconf.get('url')}/topic/${tid}`, -// }); -// })); + let to = [activitypub._constants.publicAddress]; + let cc = []; + let targets; + ({ to, cc, targets } = await activitypub.buildRecipients({ to, cc }, { pid: localId || pid, cid })); + await activitypub.send('cid', cid, Array.from(targets), { + id: `${nconf.get('url')}/post/${encodeURIComponent(localId || pid)}#activity/add/${Date.now()}`, + type: 'Add', + to, + cc, + object: utils.isNumber(pid) ? `${nconf.get('url')}/post/${pid}` : pid, + target: `${nconf.get('url')}/topic/${tid}`, + }); +})); +*/ activitypubApi.undo.flag = enabledCheck(async (caller, flag) => { if (!activitypub.helpers.isUri(flag.targetId)) { return;