This commit is contained in:
syuilo 2023-10-13 17:42:40 +09:00
parent 096fa16c4c
commit 9a986b3497
7 changed files with 19 additions and 102 deletions

View File

@ -38,18 +38,7 @@ class ChannelChannel extends Channel {
private async onNote(note: Packed<'Note'>) { private async onNote(note: Packed<'Note'>) {
if (note.channelId !== this.channelId) return; if (note.channelId !== this.channelId) return;
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user, {
detail: true,
});
}
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isUserRelated(note, this.userIdsWhoMeMuting)) return; if (isUserRelated(note, this.userIdsWhoMeMuting)) return;

View File

@ -52,18 +52,7 @@ class GlobalTimelineChannel extends Channel {
if (note.visibility !== 'public') return; if (note.visibility !== 'public') return;
if (note.channelId != null) return; if (note.channelId != null) return;
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user, {
detail: true,
});
}
// 関係ない返信は除外 // 関係ない返信は除外
if (note.reply && !this.following[note.userId]?.withReplies) { if (note.reply && !this.following[note.userId]?.withReplies) {

View File

@ -43,12 +43,7 @@ class HashtagChannel extends Channel {
const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag)))); const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag))));
if (!matched) return; if (!matched) return;
// Renoteなら再pack // TODO: ZQT: populate my reaction
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user, {
detail: true,
});
}
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isUserRelated(note, this.userIdsWhoMeMuting)) return; if (isUserRelated(note, this.userIdsWhoMeMuting)) return;

View File

@ -51,27 +51,12 @@ class HomeTimelineChannel extends Channel {
// Ignore notes from instances the user has muted // Ignore notes from instances the user has muted
if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances ?? []))) return; if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances ?? []))) return;
if (['followers', 'specified'].includes(note.visibility)) { if (note.visibility === 'followers') {
note = await this.noteEntityService.pack(note.id, this.user!, { if (!Object.hasOwn(this.following, note.userId)) return;
detail: true, } else if (note.visibility === 'specified') {
}); if (!note.visibleUserIds!.includes(this.user!.id)) return;
if (note.isHidden) {
return;
}
} else { } else {
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user!, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user!, {
detail: true,
});
}
} }
// 関係ない返信は除外 // 関係ない返信は除外

View File

@ -62,27 +62,12 @@ class HybridTimelineChannel extends Channel {
(note.channelId != null && this.followingChannels.has(note.channelId)) (note.channelId != null && this.followingChannels.has(note.channelId))
)) return; )) return;
if (['followers', 'specified'].includes(note.visibility)) { if (note.visibility === 'followers') {
note = await this.noteEntityService.pack(note.id, this.user!, { if (!Object.hasOwn(this.following, note.userId)) return;
detail: true, } else if (note.visibility === 'specified') {
}); if (!note.visibleUserIds!.includes(this.user!.id)) return;
if (note.isHidden) {
return;
}
} else { } else {
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user!, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user!, {
detail: true,
});
}
} }
// Ignore notes from instances the user has muted // Ignore notes from instances the user has muted

View File

@ -54,18 +54,7 @@ class LocalTimelineChannel extends Channel {
if (note.visibility !== 'public') return; if (note.visibility !== 'public') return;
if (note.channelId != null && !this.followingChannels.has(note.channelId)) return; if (note.channelId != null && !this.followingChannels.has(note.channelId)) return;
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user, {
detail: true,
});
}
// 関係ない返信は除外 // 関係ない返信は除外
if (note.reply && this.user && !this.following[note.userId]?.withReplies && !this.withReplies) { if (note.reply && this.user && !this.following[note.userId]?.withReplies && !this.withReplies) {

View File

@ -82,27 +82,12 @@ class UserListChannel extends Channel {
if (!Object.hasOwn(this.membershipsMap, note.userId)) return; if (!Object.hasOwn(this.membershipsMap, note.userId)) return;
if (['followers', 'specified'].includes(note.visibility)) { if (note.visibility === 'followers') {
note = await this.noteEntityService.pack(note.id, this.user, { if (!Object.hasOwn(this.following, note.userId)) return;
detail: true, } else if (note.visibility === 'specified') {
}); if (!note.visibleUserIds!.includes(this.user!.id)) return;
if (note.isHidden) {
return;
}
} else { } else {
// リプライなら再pack // TODO: ZQT: populate my reaction
if (note.replyId != null) {
note.reply = await this.noteEntityService.pack(note.replyId, this.user, {
detail: true,
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await this.noteEntityService.pack(note.renoteId, this.user, {
detail: true,
});
}
} }
// 関係ない返信は除外 // 関係ない返信は除外