Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Composer.vue')
-rw-r--r--src/components/Composer.vue28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/components/Composer.vue b/src/components/Composer.vue
index 54c4b026d..e4d7fd93a 100644
--- a/src/components/Composer.vue
+++ b/src/components/Composer.vue
@@ -407,7 +407,7 @@ export default {
keyRing: undefined,
keysMissing: [],
},
- editorMode: 'html',
+ editorMode: (this.body?.format !== 'html') ? 'plaintext' : 'html',
addShareLink: t('mail', 'Add share link from {productName} Files', { productName: OC?.theme?.name ?? 'Nextcloud' }),
requestMdn: false,
appendSignature: true,
@@ -562,7 +562,8 @@ export default {
} else {
this.selectedAlias = this.aliases[0]
}
- if (previous === NO_ALIAS_SET) {
+ // only overwrite editormode if no body provided
+ if (previous === NO_ALIAS_SET && !this.body) {
this.editorMode = this.selectedAlias.editorMode
}
},
@@ -598,28 +599,15 @@ export default {
}
this.bodyVal = html(body).value
},
- recipientToRfc822(recipient) {
- if (recipient.email === recipient.label) {
- // From mailto or sender without proper label
- return recipient.email
- } else if (recipient.label === '') {
- // Invalid label
- return recipient.email
- } else if (recipient.email.search(/^[a-zA-Z]+:/) === 0) {
- // Group integration
- return recipient.email
- } else {
- // Proper layout with label
- return `"${recipient.label}" <${recipient.email}>`
- }
- },
getMessageData(id) {
return {
+ // TODO: Rename account to accountId
account: this.selectedAlias.id,
+ accountId: this.selectedAlias.id,
aliasId: this.selectedAlias.aliasId,
- to: this.selectTo.map(this.recipientToRfc822).join(', '),
- cc: this.selectCc.map(this.recipientToRfc822).join(', '),
- bcc: this.selectBcc.map(this.recipientToRfc822).join(', '),
+ to: this.selectTo,
+ cc: this.selectCc,
+ bcc: this.selectBcc,
draftId: id,
subject: this.subjectVal,
body: this.encrypt ? plain(this.bodyVal) : html(this.bodyVal),