mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Resolve #202
This commit is contained in:
parent
93190f4071
commit
e2c171f302
6 changed files with 94 additions and 100 deletions
|
|
@ -34,6 +34,6 @@ export class IdentityModel extends AbstractModel {
|
|||
const name = this.name(),
|
||||
email = this.email();
|
||||
|
||||
return name ? name + ' (' + email + ')' : email;
|
||||
return name ? name + ' <' + email + '>' : email;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@
|
|||
background-color: rgba(0,0,0,0.8);
|
||||
|
||||
.close, .minimize-custom {
|
||||
opacity: 1;
|
||||
color: #fff;
|
||||
border-color: #eee;
|
||||
|
||||
float: none;
|
||||
font-size: 24px;
|
||||
line-height: 24px;
|
||||
opacity: 1;
|
||||
line-height: 28px;
|
||||
margin-left: .7em;
|
||||
}
|
||||
|
||||
.btn.disabled {
|
||||
|
|
@ -76,6 +76,10 @@
|
|||
.disabled.button-delete {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.pull-right * {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
.b-header {
|
||||
|
|
@ -98,20 +102,13 @@
|
|||
width: 4em;
|
||||
}
|
||||
|
||||
.e-identity {
|
||||
#identity-toggle {
|
||||
color: var(--main-color);
|
||||
font-weight: bold;
|
||||
line-height: @baseLineHeight;
|
||||
padding: 4px 0;
|
||||
margin-left: 6px;
|
||||
text-decoration: none;
|
||||
|
||||
&.multiply {
|
||||
cursor: pointer;
|
||||
border-bottom: 1px dashed var(--main-color);
|
||||
}
|
||||
&.multiply::after {
|
||||
content: ' ▼';
|
||||
}
|
||||
}
|
||||
#identity-toggle::after {
|
||||
content: '▼';
|
||||
}
|
||||
|
||||
textarea, input[type="text"] {
|
||||
|
|
@ -170,12 +167,7 @@
|
|||
border: 0 solid #333;
|
||||
border-bottom-width: 3px;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
height: 20px;
|
||||
width: 16px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ import { ThemeStore } from 'Stores/Theme';
|
|||
const
|
||||
base64_encode = text => btoa(text).match(/.{1,76}/g).join('\r\n'),
|
||||
|
||||
email = new EmailModel(),
|
||||
getEmail = value => {
|
||||
email.clear();
|
||||
email.parse(value.trim());
|
||||
return email.email || false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} prefix
|
||||
* @param {string} subject
|
||||
|
|
@ -165,6 +172,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
this.addObservables({
|
||||
identitiesDropdownTrigger: false,
|
||||
|
||||
from: '',
|
||||
to: '',
|
||||
cc: '',
|
||||
bcc: '',
|
||||
|
|
@ -214,9 +222,11 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
editorArea: null, // initDom
|
||||
|
||||
currentIdentity: IdentityUserStore()[0] || null
|
||||
currentIdentity: IdentityUserStore()[0]
|
||||
});
|
||||
|
||||
this.from(IdentityUserStore()[0].formattedName());
|
||||
|
||||
// this.to.subscribe((v) => console.log(v));
|
||||
|
||||
// Used by ko.bindingHandlers.emailsTags
|
||||
|
|
@ -289,11 +299,6 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
optText: item.formattedName()
|
||||
})),
|
||||
|
||||
currentIdentityView: () => {
|
||||
const item = this.currentIdentity();
|
||||
return item ? item.formattedName() : 'unknown';
|
||||
},
|
||||
|
||||
canBeSentOrSaved: () => !this.sending() && !this.saving()
|
||||
});
|
||||
|
||||
|
|
@ -304,11 +309,14 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
sendSuccessButSaveError: value => !value && this.savedErrorDesc(''),
|
||||
|
||||
currentIdentity: value => {
|
||||
currentIdentity: value => value && this.from(value.formattedName()),
|
||||
|
||||
from: value => {
|
||||
this.canPgpSign(false);
|
||||
value && PgpUserStore.getKeyForSigning(value.email()).then(result => {
|
||||
value = getEmail(value);
|
||||
value && PgpUserStore.getKeyForSigning(value).then(result => {
|
||||
console.log({
|
||||
email: value.email(),
|
||||
email: value,
|
||||
canPgpSign:result
|
||||
});
|
||||
this.canPgpSign(result)
|
||||
|
|
@ -373,6 +381,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
MessageFolder: this.draftsFolder(),
|
||||
MessageUid: this.draftUid(),
|
||||
SaveFolder: sSaveFolder,
|
||||
From: this.from(),
|
||||
To: this.to(),
|
||||
Cc: this.cc(),
|
||||
Bcc: this.bcc(),
|
||||
|
|
@ -730,9 +739,10 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
selectIdentity(identity) {
|
||||
if (identity && identity.item) {
|
||||
this.currentIdentity(identity.item);
|
||||
this.setSignatureFromIdentity(identity.item);
|
||||
identity = identity && identity.item;
|
||||
if (identity) {
|
||||
this.currentIdentity(identity);
|
||||
this.setSignatureFromIdentity(identity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1594,18 +1604,14 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
allRecipients() {
|
||||
const email = new EmailModel();
|
||||
return [
|
||||
// From/sender is also recipient (Sent mailbox)
|
||||
this.currentIdentity().email(),
|
||||
// this.currentIdentity().email(),
|
||||
this.from(),
|
||||
this.to(),
|
||||
this.cc(),
|
||||
this.bcc()
|
||||
].join(',').split(',').map(value => {
|
||||
email.clear();
|
||||
email.parse(value.trim());
|
||||
return email.email || false;
|
||||
}).validUnique();
|
||||
].join(',').split(',').map(value => getEmail(value.trim())).validUnique();
|
||||
}
|
||||
|
||||
initPgpEncrypt() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue