Don't complain about empty drafts
authorAndre Heinecke <aheinecke@gnupg.org>
Fri, 12 Apr 2019 09:11:39 +0000 (11:11 +0200)
committerAndre Heinecke <aheinecke@gnupg.org>
Fri, 12 Apr 2019 09:16:44 +0000 (11:16 +0200)
* src/cryptcontroller.cpp (CryptController::collect_data):
Don't complain for drafts.

--
This is a usual case because autosave can hit if you
only entered recipients and the subject.

src/cryptcontroller.cpp

index f5b4de0..da73dd7 100644 (file)
@@ -118,9 +118,12 @@ CryptController::collect_data ()
   int n_att_usable = count_usable_attachments (att_table);
   if (!n_att_usable && !body)
     {
-      gpgol_message_box (m_mail->getWindow (),
-                         utf8_gettext ("Can't encrypt / sign an empty message."),
-                         utf8_gettext ("GpgOL"), MB_OK);
+      if (!m_mail->isDraftEncrypt())
+        {
+          gpgol_message_box (m_mail->getWindow (),
+                             utf8_gettext ("Can't encrypt / sign an empty message."),
+                             utf8_gettext ("GpgOL"), MB_OK);
+        }
       gpgol_release (message);
       mapi_release_attach_table (att_table);
       xfree (body);