getCurrentIdentity method now uses also the folder owner to get the right identity for a reply. see #627

This commit is contained in:
mic 2026-02-03 22:00:55 +01:00
parent 5e58dc940f
commit 6ebc50b005

View file

@ -94,6 +94,17 @@ export async function getCurrentIdentity(msgHeader, getFull = false) {
}
}
// Check the account that the folder of the message belongs to
if (msgHeader.folder && msgHeader.folder.accountId) {
const account = accounts.find(a => a.id === msgHeader.folder.accountId);
if (account && account.identities && account.identities.length > 0) {
// Just return the first identity of the account.
const identity = account.identities[0];
console.log(">>>>>>>>>> got from folder");
return getFull ? { id: identity.id, email: identity.email } : identity.id;
}
}
// Fallback
return getFull ? fallbackIdentity : fallbackIdentity?.id || null;
}