wip
This commit is contained in:
parent
096fa16c4c
commit
9a986b3497
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 関係ない返信は除外
|
// 関係ない返信は除外
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 関係ない返信は除外
|
// 関係ない返信は除外
|
||||||
|
|
Loading…
Reference in New Issue