fix: include myself

This commit is contained in:
Namekuji 2023-08-14 02:53:28 -04:00
parent c9dd562145
commit 4f5f601c1d
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -236,17 +236,17 @@ export default async function (
}); });
const noteUserIds = new Set(notesToDelete.map((n) => n.userId)); const noteUserIds = new Set(notesToDelete.map((n) => n.userId));
const followers: string[] = []; const meAndFollowers: string[] = [note.userId];
for (const id of noteUserIds) { for (const id of noteUserIds) {
const list = await LocalFollowersCache.init(id).then((cache) => const list = await LocalFollowersCache.init(id).then((cache) =>
cache.getAll(), cache.getAll(),
); );
followers.push(...list); meAndFollowers.push(...list);
} }
const localFollowers = new Set(followers); const feedUserIds = new Set(meAndFollowers);
const homeDeleteParams = notesToDelete.map((n) => { const homeDeleteParams = notesToDelete.map((n) => {
const tuples: [string, Date, Date, string][] = []; const tuples: [string, Date, Date, string][] = [];
for (const feedUserId of localFollowers) { for (const feedUserId of feedUserIds) {
tuples.push([feedUserId, n.createdAt, n.createdAt, n.userId]); tuples.push([feedUserId, n.createdAt, n.createdAt, n.userId]);
} }
return tuples; return tuples;