diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-09-17 23:07:15 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-09-17 23:07:15 +0900 |
| commit | 44f6fe6f1fa3873d6b6950dc5746725f014a1bb1 (patch) | |
| tree | 6e3593d17111e620312642dee58cb89db99e0040 /src/server/api/stream/local-timeline.ts | |
| parent | No lint when test (diff) | |
| download | misskey-44f6fe6f1fa3873d6b6950dc5746725f014a1bb1.tar.gz misskey-44f6fe6f1fa3873d6b6950dc5746725f014a1bb1.tar.bz2 misskey-44f6fe6f1fa3873d6b6950dc5746725f014a1bb1.zip | |
Refactor: Extract shouldMuteThisNote function
Diffstat (limited to 'src/server/api/stream/local-timeline.ts')
| -rw-r--r-- | src/server/api/stream/local-timeline.ts | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/server/api/stream/local-timeline.ts b/src/server/api/stream/local-timeline.ts index e21c071bab..ae054a5f9f 100644 --- a/src/server/api/stream/local-timeline.ts +++ b/src/server/api/stream/local-timeline.ts @@ -4,6 +4,7 @@ import Xev from 'xev'; import { IUser } from '../../../models/user'; import Mute from '../../../models/mute'; import { pack } from '../../../models/note'; +import shouldMuteThisNote from '../../../misc/should-mute-this-note'; export default async function( request: websocket.request, @@ -23,17 +24,8 @@ export default async function( }); } - //#region 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する - if (mutedUserIds.indexOf(note.userId) != -1) { - return; - } - if (note.reply != null && mutedUserIds.indexOf(note.reply.userId) != -1) { - return; - } - if (note.renote != null && mutedUserIds.indexOf(note.renote.userId) != -1) { - return; - } - //#endregion + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (shouldMuteThisNote(note, mutedUserIds)) return; connection.send(JSON.stringify({ type: 'note', |