mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
fix: simplicity tweak
This commit is contained in:
@@ -218,7 +218,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
mainPost.tid = tid;
|
mainPost.tid = tid;
|
||||||
|
|
||||||
const urlMap = chain.reduce((map, post) => (post.url ? map.set(post.url, post.id) : map), new Map());
|
const urlMap = chain.reduce((map, post) => (post.url ? map.set(post.url, post.id) : map), new Map());
|
||||||
const unprocessed = chain.map((post) => {
|
let unprocessed = chain.map((post) => {
|
||||||
post.tid = tid; // add tid to post hash
|
post.tid = tid; // add tid to post hash
|
||||||
|
|
||||||
// Ensure toPids in replies are ids
|
// Ensure toPids in replies are ids
|
||||||
@@ -275,13 +275,10 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
}, new Set()));
|
}, new Set()));
|
||||||
const isBanned = await user.bans.isBanned(uids);
|
const isBanned = await user.bans.isBanned(uids);
|
||||||
const banned = uids.filter((_, idx) => isBanned[idx]);
|
const banned = uids.filter((_, idx) => isBanned[idx]);
|
||||||
|
unprocessed = unprocessed.filter(post => banned.includes(post.uid));
|
||||||
|
|
||||||
let added = [];
|
let added = [];
|
||||||
await Promise.all(unprocessed.map(async (post) => {
|
await Promise.all(unprocessed.map(async (post) => {
|
||||||
if (banned.includes(post.uid)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { to, cc } = post._activitypub;
|
const { to, cc } = post._activitypub;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user