mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Allow empty message body when there are attachments #1052
This commit is contained in:
parent
103b431780
commit
2adccdbaf3
1 changed files with 9 additions and 5 deletions
|
|
@ -1355,10 +1355,15 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
async getMessageRequestParams(sSaveFolder, draft)
|
async getMessageRequestParams(sSaveFolder, draft)
|
||||||
{
|
{
|
||||||
|
let Text = this.oEditor.getData().trim(),
|
||||||
|
l = Text.length,
|
||||||
|
hasAttachments = 0;
|
||||||
|
|
||||||
// Prepare ComposeAttachmentModel attachments
|
// Prepare ComposeAttachmentModel attachments
|
||||||
const attachments = {};
|
const attachments = {};
|
||||||
this.attachments.forEach(item => {
|
this.attachments.forEach(item => {
|
||||||
if (item?.complete() && item?.tempName() && item?.enabled()) {
|
if (item?.complete() && item?.tempName() && item?.enabled()) {
|
||||||
|
++hasAttachments;
|
||||||
attachments[item.tempName()] = {
|
attachments[item.tempName()] = {
|
||||||
name: item.fileName(),
|
name: item.fileName(),
|
||||||
inline: item.isInline,
|
inline: item.isInline,
|
||||||
|
|
@ -1369,6 +1374,10 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!draft && !l && !hasAttachments) {
|
||||||
|
throw i18n('COMPOSE/ERROR_EMPTY_BODY');
|
||||||
|
}
|
||||||
|
|
||||||
const
|
const
|
||||||
identity = this.currentIdentity(),
|
identity = this.currentIdentity(),
|
||||||
params = {
|
params = {
|
||||||
|
|
@ -1397,12 +1406,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
encrypt = this.pgpEncrypt() && this.canPgpEncrypt(),
|
encrypt = this.pgpEncrypt() && this.canPgpEncrypt(),
|
||||||
isHtml = this.oEditor.isHtml();
|
isHtml = this.oEditor.isHtml();
|
||||||
|
|
||||||
let Text = this.oEditor.getData().trim();
|
|
||||||
if (!draft && !Text.length) {
|
|
||||||
throw i18n('COMPOSE/ERROR_EMPTY_BODY');
|
|
||||||
}
|
|
||||||
if (isHtml) {
|
if (isHtml) {
|
||||||
let l;
|
|
||||||
do {
|
do {
|
||||||
l = Text.length;
|
l = Text.length;
|
||||||
Text = Text
|
Text = Text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue