diff --git a/dev/Model/Identity.js b/dev/Model/Identity.js index cd7714f87..66e5d0fbd 100644 --- a/dev/Model/Identity.js +++ b/dev/Model/Identity.js @@ -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(); diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 2f30123f4..ca691df68 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -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);