Mail: folder unread counts refresh at once after a change, read state survives a late list, no wrong message after quick clicks, mark unread keeps the message in the list
build-container / build (push) Successful in 21m39s
build-container / build (push) Successful in 21m39s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
89fd595809
commit
a3010299d0
4 files changed
+29
-9
No files matched your search
+3
-1
@@ -191,6 +191,8 @@ async function del(a, mid, permanent) {
|
||||
const [path, uid] = dec(mid);
|
||||
return withClient(a, async client => { const lock = await client.getMailboxLock(path); try { await client.messageDelete(String(uid), { uid: true }); } finally { lock.release(); } });
|
||||
}
|
||||
/** Counts shown in the folder list are kept 30 s; reading, moving, deleting or sending changes them, so the next request must ask again. */
|
||||
const dropFolders = id => { if (id) folderCache.delete(id); else folderCache.clear(); };
|
||||
async function unread(a) { return withClient(a, async client => (await client.status('INBOX', { unseen: true })).unseen || 0); }
|
||||
|
||||
// ---- sending
|
||||
@@ -251,4 +253,4 @@ async function connectNew({ type, address, password }) {
|
||||
return { type, address: addr, pass, name: '' };
|
||||
}
|
||||
|
||||
module.exports = { PRESETS: Object.fromEntries(Object.entries(PRESETS).map(([k, v]) => [k, { name: v.name }])), folders, list, message, attachment, update, move, del, unread, send, reply, connectNew, forget };
|
||||
module.exports = { dropFolders, PRESETS: Object.fromEntries(Object.entries(PRESETS).map(([k, v]) => [k, { name: v.name }])), folders, list, message, attachment, update, move, del, unread, send, reply, connectNew, forget };
|
||||
Reference in new issue
Block a user