Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 534b71e

Browse files
author
the-djmaze
committed
On reply, set from field to the received email to field #1805
1 parent f0b3d79 commit 534b71e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

dev/Model/Identity.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { EmailModel } from 'Model/Email';
33
import { addObservablesTo, addComputablesTo } from 'External/ko';
44

55
export class IdentityModel extends EmailModel /*AbstractModel*/ {
6-
/**
7-
* @param {string} id
8-
* @param {string} email
9-
*/
106
constructor() {
117
super();
128

dev/View/Popup/Compose.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import Remote from 'Remote/User/Fetch';
4444

4545
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
4646
import { EmailModel } from 'Model/Email';
47+
import { IdentityModel } from 'Model/Identity';
4748
import { MimeHeaderAutocryptModel } from 'Model/MimeHeaderAutocrypt';
4849
import { addressparser } from 'Mime/Address';
4950

@@ -871,6 +872,16 @@ export class ComposePopupView extends AbstractViewPopup {
871872
// case ComposeType.Empty:
872873
}
873874
}
875+
// Set from custom email
876+
if (!identity
877+
&& oLastMessage && (ComposeType.Reply === options.mode || ComposeType.ReplyAll === options.mode)
878+
&& 1 === oLastMessage.to.length
879+
// && mEmail.includes(oLastMessage.to[0].domain)
880+
) {
881+
identity = new IdentityModel;
882+
identity.name = oLastMessage.to[0].name;
883+
identity.email = oLastMessage.to[0].email;
884+
}
874885
identity = identity || IdentityUserStore()[0];
875886
if (identity) {
876887
// excludeEmail.add(identity.email);

0 commit comments

Comments
 (0)