diff options
Diffstat (limited to 'src/misc')
| -rw-r--r-- | src/misc/should-mute-this-note.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/misc/should-mute-this-note.ts b/src/misc/should-mute-this-note.ts new file mode 100644 index 0000000000..c818115a3c --- /dev/null +++ b/src/misc/should-mute-this-note.ts @@ -0,0 +1,15 @@ +export default function(note: any, mutedUserIds: string[]): boolean { + if (mutedUserIds.indexOf(note.userId) != -1) { + return true; + } + + if (note.reply != null && mutedUserIds.indexOf(note.reply.userId) != -1) { + return true; + } + + if (note.renote != null && mutedUserIds.indexOf(note.renote.userId) != -1) { + return true; + } + + return false; +} |