Skip to content

Commit

Permalink
Fix: kokonect-link#449 で変えた部分の修正2 (kokonect-link#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net authored Oct 17, 2024
1 parent 8b0fd6f commit 5f02ee4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/backend/src/core/AdvancedSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,14 +1110,10 @@ export class AdvancedSearchService {
}
if (followingFilter === 'following' && !Followings.includes(Note._source.userId)) return null;
if (followingFilter === 'notFollowing' && Followings.includes(Note._source.userId)) return null;

if (Note._source.userId === meUserId) {//自分のノート
return Note;
}
}

const user = await this.cacheService.findUserById(Note._source.userId);
if (user.isIndexable === false) { //検索許可されていないが、
if (user.isIndexable === false && meUserId !== undefined && user.id !== meUserId) { //検索許可されていないが、
if (!meUserId || !this.opensearch) {
return null;
}
Expand Down Expand Up @@ -1187,11 +1183,13 @@ export class AdvancedSearchService {
if (meUserId) {
if (Note._source.visibility === 'followers') { //鍵だけどフォローしてる
if (Followings.includes(Note._source.userId)) return Note;
if (Note._source.userId === meUserId) return Note;//または自分
}

if (Note._source.visibility === 'specified') {//自分が宛先に含まれている
if (Note._source.visibleUserIds) {
if (Note._source.visibleUserIds.includes(meUserId)) return Note;
if (Note._source.userId === meUserId) return Note;//または自分
}
}
}
Expand Down

0 comments on commit 5f02ee4

Please sign in to comment.