diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-01-30 04:37:25 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-30 04:37:25 +0900 |
| commit | f6154dc0af1a0d65819e87240f4385f9573095cb (patch) | |
| tree | 699a5ca07d6727b7f8497d4769f25d6d62f94b5a /src/client/app/common/scripts/should-mute-note.ts | |
| parent | Add Event activity-type support (#5785) (diff) | |
| download | sharkey-f6154dc0af1a0d65819e87240f4385f9573095cb.tar.gz sharkey-f6154dc0af1a0d65819e87240f4385f9573095cb.tar.bz2 sharkey-f6154dc0af1a0d65819e87240f4385f9573095cb.zip | |
v12 (#5712)
Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com>
Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
Diffstat (limited to 'src/client/app/common/scripts/should-mute-note.ts')
| -rw-r--r-- | src/client/app/common/scripts/should-mute-note.ts | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/client/app/common/scripts/should-mute-note.ts b/src/client/app/common/scripts/should-mute-note.ts deleted file mode 100644 index 8fd7888628..0000000000 --- a/src/client/app/common/scripts/should-mute-note.ts +++ /dev/null @@ -1,19 +0,0 @@ -export default function(me, settings, note) { - const isMyNote = me && (note.userId == me.id); - const isPureRenote = note.renoteId != null && note.text == null && note.fileIds.length == 0 && note.poll == null; - - const includesMutedWords = (text: string) => - text - ? settings.mutedWords.some(q => q.length > 0 && !q.some(word => - word.startsWith('/') && word.endsWith('/') ? !(new RegExp(word.substr(1, word.length - 2)).test(text)) : !text.includes(word))) - : false; - - return ( - (!isMyNote && note.reply && includesMutedWords(note.reply.text)) || - (!isMyNote && note.renote && includesMutedWords(note.renote.text)) || - (!settings.showMyRenotes && isMyNote && isPureRenote) || - (!settings.showRenotedMyNotes && isPureRenote && note.renote.userId == me.id) || - (!settings.showLocalRenotes && isPureRenote && note.renote.user.host == null) || - (!isMyNote && includesMutedWords(note.text)) - ); -} |