On reply, set from field to the received email to field #1805

This commit is contained in:
the-djmaze 2024-10-23 01:27:29 +02:00
parent f0b3d798bc
commit 534b71e5a4
2 changed files with 11 additions and 4 deletions

View file

@ -3,10 +3,6 @@ import { EmailModel } from 'Model/Email';
import { addObservablesTo, addComputablesTo } from 'External/ko';
export class IdentityModel extends EmailModel /*AbstractModel*/ {
/**
* @param {string} id
* @param {string} email
*/
constructor() {
super();

View file

@ -44,6 +44,7 @@ import Remote from 'Remote/User/Fetch';
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
import { EmailModel } from 'Model/Email';
import { IdentityModel } from 'Model/Identity';
import { MimeHeaderAutocryptModel } from 'Model/MimeHeaderAutocrypt';
import { addressparser } from 'Mime/Address';
@ -871,6 +872,16 @@ export class ComposePopupView extends AbstractViewPopup {
// case ComposeType.Empty:
}
}
// Set from custom email
if (!identity
&& oLastMessage && (ComposeType.Reply === options.mode || ComposeType.ReplyAll === options.mode)
&& 1 === oLastMessage.to.length
// && mEmail.includes(oLastMessage.to[0].domain)
) {
identity = new IdentityModel;
identity.name = oLastMessage.to[0].name;
identity.email = oLastMessage.to[0].email;
}
identity = identity || IdentityUserStore()[0];
if (identity) {
// excludeEmail.add(identity.email);