Compare commits

...

14 Commits

Author SHA1 Message Date
Sayamame-beans 276b9bf6ae
Merge 400aafddd7 into 4603ab67bb 2024-11-20 21:23:55 +09:00
Sayamame-beans 400aafddd7
Merge branch 'develop' into mute_note_has_muting_mention 2024-11-19 22:49:40 +09:00
Sayamame-beans 597412abcc fix(backend): incorrect typing with query 2024-11-19 13:11:33 +00:00
Sayamame-beans 590d5dd0bf
Merge branch 'develop' into mute_note_has_muting_mention 2024-11-19 19:24:59 +09:00
Sayamame-beans 32f4b639c9 fix(backend): fix lint 2024-11-18 23:35:23 +09:00
Sayamame-beans 36ae25e4bc
Merge branch 'develop' into mute_note_has_muting_mention 2024-11-18 23:18:15 +09:00
Sayamame-beans bcf255a00b docs(changelog): update changelog 2024-11-18 23:13:37 +09:00
Sayamame-beans 446238026a fix(backend): mention was not considered for mute (query ver) 2024-11-18 22:58:39 +09:00
Sayamame-beans 6d07f683eb Revert "docs(changelog): update changelog"
This reverts commit 0bcd79b577.
2024-07-15 22:48:20 +09:00
Sayamame-beans 3d2b495829 Revert "fix(backend): visibleUserIds was not considered for mute"
This reverts commit b8a4a33695.
2024-07-15 22:48:13 +09:00
Sayamame-beans 0bcd79b577 docs(changelog): update changelog 2024-06-23 12:19:18 +00:00
Sayamame-beans 51e4897fb8 docs(changelog): update changelog 2024-06-23 12:18:23 +00:00
Sayamame-beans b8a4a33695 fix(backend): visibleUserIds was not considered for mute 2024-06-23 12:15:44 +00:00
Sayamame-beans 959aba6b13 fix(backend): mention was not considered for mute 2024-06-23 12:14:46 +00:00
4 changed files with 23 additions and 2 deletions

View File

@ -65,6 +65,8 @@
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/709)
- Fix: User Webhookテスト機能のMock Payloadを修正
- Fix: アカウント削除のモデレーションログが動作していないのを修正 (#14996)
- Fix: ユーザーミュートにおいて、ノート内のメンションが考慮されていなかった問題を修正
- これにより、第三者から自分に対するノートを意図せず取り逃してしまう可能性があったため、通知欄ではメンションを考慮しないままになっています
### Misskey.js
- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正

View File

@ -127,13 +127,18 @@ export class QueryService {
}
@bindThis
public generateMutedUserQuery(q: SelectQueryBuilder<any>, me: { id: MiUser['id'] }, exclude?: { id: MiUser['id'] }): void {
public generateMutedUserQuery(q: SelectQueryBuilder<any>, me: { id: MiUser['id'] }, exclude?: { id: MiUser['id'] }, checkMentions: boolean = true): void {
const mutingQuery = this.mutingsRepository.createQueryBuilder('muting')
.select('muting.muteeId')
.where('muting.muterId = :muterId', { muterId: me.id });
const mutingArrayQuery = this.mutingsRepository.createQueryBuilder('muting')
.select('array_agg(muting.muteeId)', 'muting.muteeIdArray')
.where('muting.muterId = :muterId', { muterId: me.id });
if (exclude) {
mutingQuery.andWhere('muting.muteeId != :excludeId', { excludeId: exclude.id });
mutingArrayQuery.andWhere('muting.muteeId != :excludeId', { excludeId: exclude.id });
}
const mutingInstanceQuery = this.userProfilesRepository.createQueryBuilder('user_profile')
@ -172,7 +177,17 @@ export class QueryService {
.orWhere(`NOT ((${ mutingInstanceQuery.getQuery() })::jsonb ? note.renoteUserHost)`);
}));
// 投稿に含まれるメンションの相手をミュートしていない
if (checkMentions) {
q.andWhere(new Brackets(qb => {
qb
.where('note.mentions IS NULL')
.orWhere(`NOT (note.mentions && (${ mutingArrayQuery.getQuery() }))`);
}));
}
q.setParameters(mutingQuery.getParameters());
q.setParameters(mutingArrayQuery.getParameters());
q.setParameters(mutingInstanceQuery.getParameters());
}

View File

@ -12,6 +12,10 @@ export function isUserRelated(note: any, userIds: Set<string>, ignoreAuthor = fa
return true;
}
if (note.mentions != null && note.mentions.filter((userId: string) => userId !== note.userId && userIds.has(userId)).length > 0) {
return true;
}
if (note.reply != null && note.reply.userId !== note.userId && userIds.has(note.reply.userId)) {
return true;
}

View File

@ -74,7 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.leftJoinAndSelect('renote.user', 'renoteUser');
this.queryService.generateVisibilityQuery(query, me);
this.queryService.generateMutedUserQuery(query, me);
this.queryService.generateMutedUserQuery(query, me, undefined, false); // 通知系ではメンションを確認しないようにする
this.queryService.generateMutedNoteThreadQuery(query, me);
this.queryService.generateBlockedUserQuery(query, me);