Skip to content

Commit

Permalink
tweak tl
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Oct 4, 2023
1 parent ca515d5 commit fb63fc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/misc/is-user-related.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export function isUserRelated(note: any, userIds: Set<string>, ignoreAuthor = fa
return true;
}

if (note.reply != null && userIds.has(note.reply.userId)) {
if (note.reply != null && note.reply.userId !== note.userId && userIds.has(note.reply.userId)) {
return true;
}

if (note.renote != null && userIds.has(note.renote.userId)) {
if (note.renote != null && note.renote.userId !== note.userId && userIds.has(note.renote.userId)) {
return true;
}

Expand Down
8 changes: 6 additions & 2 deletions packages/backend/test/e2e/timelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -856,13 +856,17 @@ describe('Timelines', () => {

await api('/mute/create', { userId: bob.id }, alice);
await sleep(1000);
const bobNote = await post(bob, { text: 'hi' });
const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { text: 'hi', replyId: bobNote1.id });
const bobNote3 = await post(bob, { text: 'hi', renoteId: bobNote1.id });

await waitForPushToTl();

const res = await api('/users/notes', { userId: bob.id }, alice);

assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote3.id), true);
});
});

Expand Down

0 comments on commit fb63fc1

Please sign in to comment.