mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
fix null check in local/global/list channels
This commit is contained in:
parent
5035287571
commit
0866e87ce6
3 changed files with 4 additions and 4 deletions
|
@ -65,7 +65,7 @@ class GlobalTimelineChannel extends Channel {
|
||||||
if (!this.isNoteVisibleToMe(reply)) return;
|
if (!this.isNoteVisibleToMe(reply)) return;
|
||||||
if (!this.following[note.userId]?.withReplies) {
|
if (!this.following[note.userId]?.withReplies) {
|
||||||
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
|
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
|
||||||
if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
|
if (reply.userId !== this.user?.id && !isMe && reply.userId !== note.userId) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class LocalTimelineChannel extends Channel {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async onNote(note: Packed<'Note'>) {
|
private async onNote(note: Packed<'Note'>) {
|
||||||
const isMe = this.user!.id === note.userId;
|
const isMe = this.user?.id === note.userId;
|
||||||
|
|
||||||
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
|
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
|
||||||
if (!this.withBots && note.user.isBot) return;
|
if (!this.withBots && note.user.isBot) return;
|
||||||
|
@ -69,7 +69,7 @@ class LocalTimelineChannel extends Channel {
|
||||||
if (!this.isNoteVisibleToMe(reply)) return;
|
if (!this.isNoteVisibleToMe(reply)) return;
|
||||||
if (!this.following[note.userId]?.withReplies) {
|
if (!this.following[note.userId]?.withReplies) {
|
||||||
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
|
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
|
||||||
if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
|
if (reply.userId !== this.user?.id && !isMe && reply.userId !== note.userId) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ class UserListChannel extends Channel {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async onNote(note: Packed<'Note'>) {
|
private async onNote(note: Packed<'Note'>) {
|
||||||
const isMe = this.user!.id === note.userId;
|
const isMe = this.user?.id === note.userId;
|
||||||
|
|
||||||
// チャンネル投稿は無視する
|
// チャンネル投稿は無視する
|
||||||
if (note.channelId) return;
|
if (note.channelId) return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue