1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 04:04:16 +00:00

enhance(backend): フォローしているユーザーならフォロワー限定投稿のノートでもアンテナで検知できるように (#15264)

* フォローしているユーザーなら鍵ノートでもアンテナにひっかかるように

Co-authored-by: kozakura913 <98575220+kozakura913@users.noreply.github.com>
Co-authored-by: mai <74494945+chan-mai@users.noreply.github.com>

* Eliminate build errors by resolving conflicts

* 低コストな判定文を前にもってきて重い判定文に入る可能性を少しでも下げる

* fix CHANGELOG.md

* fix CHANGELOG.md

* fix diff

* removed comment

* fix CHANGELOG.md

---------

Co-authored-by: kozakura913 <98575220+kozakura913@users.noreply.github.com>
Co-authored-by: mai <74494945+chan-mai@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
おさむのひと
2025-04-13 20:48:18 +09:00
committed by GitHub
parent 1f0621b085
commit 0d4feed6d3
3 changed files with 45 additions and 23 deletions

View File

@@ -6,7 +6,6 @@
process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
import {
api,
failedApiCall,
@@ -19,6 +18,7 @@ import {
userList,
} from '../utils.js';
import type * as misskey from 'misskey-js';
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
const compareBy = <T extends { id: string }>(selector: (s: T) => string = (s: T): string => s.id) => (a: T, b: T): number => {
return selector(a).localeCompare(selector(b));
@@ -235,12 +235,12 @@ describe('アンテナ', () => {
await failedApiCall({
endpoint: 'antennas/create',
parameters: { ...defaultParam, keywords: [[]], excludeKeywords: [[]] },
user: alice
user: alice,
}, {
status: 400,
code: 'EMPTY_KEYWORD',
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a'
})
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a',
});
});
//#endregion
//#region 更新(antennas/update)
@@ -274,12 +274,12 @@ describe('アンテナ', () => {
await failedApiCall({
endpoint: 'antennas/update',
parameters: { ...defaultParam, antennaId: antenna.id, keywords: [[]], excludeKeywords: [[]] },
user: alice
user: alice,
}, {
status: 400,
code: 'EMPTY_KEYWORD',
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4'
})
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4',
});
});
//#endregion
@@ -375,14 +375,23 @@ describe('アンテナ', () => {
],
},
{
// https://github.com/misskey-dev/misskey/issues/9025
label: 'ただし、フォロワー限定投稿とDM投稿を含まない。フォロワーであっても。',
label: 'フォロワー限定投稿とDM投稿を含む',
parameters: () => ({}),
posts: [
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'public' }), included: true },
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'home' }), included: true },
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }) },
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }) },
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }), included: true },
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }), included: true },
],
},
{
label: 'フォロワー限定投稿とDM投稿を含まない',
parameters: () => ({}),
posts: [
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'public' }), included: true },
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'home' }), included: true },
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'followers' }) },
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [carol.id] }) },
],
},
{