mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
feat: add focus mode
This commit is contained in:
@@ -157,6 +157,8 @@ export default class NotificationOptions
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check channel notification settings
|
||||
const mentioned = message.mention_ids?.includes(user._id);
|
||||
switch (this.computeForChannel(message.channel!)) {
|
||||
case "muted":
|
||||
case "none":
|
||||
@@ -164,7 +166,12 @@ export default class NotificationOptions
|
||||
return false;
|
||||
case "mention":
|
||||
// Ignore if it doesn't mention us.
|
||||
if (!message.mention_ids?.includes(user._id)) return false;
|
||||
if (!mentioned) return false;
|
||||
}
|
||||
|
||||
// Check if we are in focus mode
|
||||
if (user.status?.presence === "Focus" && !mentioned) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user