mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
lint: fix tabs
This commit is contained in:
@@ -387,33 +387,34 @@ activitypubApi.flag = enabledCheck(async (caller, flag) => {
|
|||||||
await db.sortedSetAdd(`flag:${flag.flagId}:remote`, Date.now(), caller.uid);
|
await db.sortedSetAdd(`flag:${flag.flagId}:remote`, Date.now(), caller.uid);
|
||||||
});
|
});
|
||||||
|
|
||||||
// activitypubApi.add = enabledCheck((async (_, { pid }) => {
|
/*
|
||||||
// let localId;
|
activitypubApi.add = enabledCheck((async (_, { pid }) => {
|
||||||
// if (String(pid).startsWith(nconf.get('url'))) {
|
let localId;
|
||||||
// ({ id: localId } = await activitypub.helpers.resolveLocalId(pid));
|
if (String(pid).startsWith(nconf.get('url'))) {
|
||||||
// }
|
({ id: localId } = await activitypub.helpers.resolveLocalId(pid));
|
||||||
|
}
|
||||||
|
|
||||||
// const tid = await posts.getPostField(localId || pid, 'tid');
|
const tid = await posts.getPostField(localId || pid, 'tid');
|
||||||
// const cid = await posts.getCidByPid(localId || pid);
|
const cid = await posts.getCidByPid(localId || pid);
|
||||||
// if (!utils.isNumber(tid) || cid <= 0) { // `Add` only federated on categorized topics started locally
|
if (!utils.isNumber(tid) || cid <= 0) { // `Add` only federated on categorized topics started locally
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// let to = [activitypub._constants.publicAddress];
|
let to = [activitypub._constants.publicAddress];
|
||||||
// let cc = [];
|
let cc = [];
|
||||||
// let targets;
|
let targets;
|
||||||
// ({ to, cc, targets } = await activitypub.buildRecipients({ to, cc }, { pid: localId || pid, cid }));
|
({ 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}`,
|
|
||||||
// });
|
|
||||||
// }));
|
|
||||||
|
|
||||||
|
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) => {
|
activitypubApi.undo.flag = enabledCheck(async (caller, flag) => {
|
||||||
if (!activitypub.helpers.isUri(flag.targetId)) {
|
if (!activitypub.helpers.isUri(flag.targetId)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user