1 parent
5dc9db0b1c
commit
83440f20e2
28 files changed
+1925
-213
No files matched your search
@@ -239,8 +239,21 @@ function suppressRealtimeNotificationsForFolder(folder, accountId = state.accoun
|
||||
};
|
||||
}
|
||||
|
||||
function realtimeFolderIsDrafts(folderName) {
|
||||
const name = String(folderName || "");
|
||||
if (!name) return false;
|
||||
const configured = state.specialFolders?.drafts;
|
||||
if (configured && name.toLowerCase() === String(configured).toLowerCase()) return true;
|
||||
const meta = state.folders.find((folder) => String(folder?.name || "").toLowerCase() === name.toLowerCase());
|
||||
const attrs = Array.isArray(meta?.attributes) ? meta.attributes : String(meta?.attributes || "").split(/\s+/);
|
||||
if (attrs.some((value) => String(value).trim().toLowerCase() === "\\drafts")) return true;
|
||||
const leaf = name.split(/[\/.]/).filter(Boolean).at(-1)?.toLowerCase();
|
||||
return leaf === "draft" || leaf === "drafts";
|
||||
}
|
||||
|
||||
function realtimeNewMailNotificationsSuppressed(data, accountId) {
|
||||
if (!state.realtimeNotificationsReady) return true;
|
||||
if (realtimeFolderIsDrafts(data?.folder)) return true;
|
||||
return (state.realtimeNotificationSuppressions.get(realtimeNotificationSuppressionKey(data?.folder, accountId)) || 0) > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user