Keep Cc recipients in reply-all

* fix: populate window._myEmailAddress from the active email account

* fix: keep Cc recipients in reply-all when own address is empty or unknown

* test: cover reply-all recipient building (issue #360)
This commit is contained in:
Afonso Coutinho
2026-06-01 10:29:22 +01:00
committed by GitHub
parent 3884f2b8b7
commit 16d6484492
4 changed files with 89 additions and 11 deletions
+9
View File
@@ -492,6 +492,15 @@ function _libCacheWriteBack() {
// Simple global rather than cross-module import to keep coupling minimal.
function _publishActiveAccount() {
try { window.__odysseusActiveEmailAccount = state._libAccountId || null; } catch (_) {}
// Publish the active account's own address so reply-all can exclude us from
// the recipient list. This global was read in emailInbox.js but never set.
try {
const accts = state._libAccounts || [];
const active = accts.find(a => a && a.id === state._libAccountId)
|| accts.find(a => a && a.is_default)
|| accts[0];
window._myEmailAddress = (active && (active.from_address || active.imap_user)) || '';
} catch (_) {}
}
export function initEmailLibrary(config) {