[geary/wip/draft-management: 19/27] Restore and show reply-to and bcc headers if present in draft



commit c6d4887b9e85103ae4f48103d203aafd1037b3bb
Author: Michael Gratton <mike vee net>
Date:   Mon Jul 22 22:58:09 2019 +1000

    Restore and show reply-to and bcc headers if present in draft
    
    See #36

 src/client/composer/composer-widget.vala | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index c744668b..88904a7e 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -755,14 +755,21 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
         switch (this.compose_type) {
             // Restoring a draft
             case ComposeType.NEW_MESSAGE:
+                bool show_extended = false;
                 if (referred.from != null)
                     this.from = referred.from;
                 if (referred.to != null)
                     this.to_entry.addresses = referred.to;
                 if (referred.cc != null)
                     this.cc_entry.addresses = referred.cc;
-                if (referred.bcc != null)
+                if (referred.bcc != null) {
+                    show_extended = true;
                     this.bcc_entry.addresses = referred.bcc;
+                }
+                if (referred.reply_to != null) {
+                    show_extended = true;
+                    this.reply_to_entry.addresses = referred.reply_to;
+                }
                 if (referred.in_reply_to != null)
                     this.in_reply_to.add_all(referred.in_reply_to.list);
                 if (referred.references != null)
@@ -779,6 +786,14 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
                 } catch (Error error) {
                     debug("Error getting draft message body: %s", error.message);
                 }
+                if (show_extended) {
+                    this.editor_actions.change_action_state(
+                        ACTION_SHOW_EXTENDED, true
+                    );
+                    this.composer_actions.change_action_state(
+                        ACTION_SHOW_EXTENDED, true
+                    );
+                }
             break;
 
             case ComposeType.REPLY:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]