[evolution/gnome-3-26] Bug 788639 - Allow use of no Name in composer "From Override"



commit 13ed098f8e0cd9e2705a9a26153df77d86f84063
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 10 16:07:40 2017 +0200

    Bug 788639 - Allow use of no Name in composer "From Override"

 src/composer/e-msg-composer.c                      |    9 +++++++--
 .../composer-to-meeting/e-composer-to-meeting.c    |    9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/composer/e-msg-composer.c b/src/composer/e-msg-composer.c
index 974c280..0d4c555 100644
--- a/src/composer/e-msg-composer.c
+++ b/src/composer/e-msg-composer.c
@@ -519,14 +519,19 @@ build_message_headers (EMsgComposer *composer,
                const gchar *name = NULL, *address = NULL;
                const gchar *transport_uid;
                const gchar *sent_folder = NULL;
+               gboolean is_from_override = FALSE;
 
                composer_header = e_composer_header_table_get_header (table, E_COMPOSER_HEADER_FROM);
                if (e_composer_from_header_get_override_visible (E_COMPOSER_FROM_HEADER (composer_header))) {
                        name = e_composer_header_table_get_from_name (table);
                        address = e_composer_header_table_get_from_address (table);
 
-                       if (address && !*address)
+                       if (address && !*address) {
+                               name = NULL;
                                address = NULL;
+                       }
+
+                       is_from_override = address != NULL;
                }
 
                if (!address) {
@@ -536,7 +541,7 @@ build_message_headers (EMsgComposer *composer,
                                address = alias_address;
                }
 
-               if (!address || !name || !*name) {
+               if (!is_from_override && (!address || !name || !*name)) {
                        ESourceMailIdentity *mail_identity;
 
                        mail_identity = e_source_get_extension (source, E_SOURCE_EXTENSION_MAIL_IDENTITY);
diff --git a/src/modules/composer-to-meeting/e-composer-to-meeting.c 
b/src/modules/composer-to-meeting/e-composer-to-meeting.c
index cda743d..e13a2cd 100644
--- a/src/modules/composer-to-meeting/e-composer-to-meeting.c
+++ b/src/modules/composer-to-meeting/e-composer-to-meeting.c
@@ -113,14 +113,19 @@ composer_to_meeting_component (EMsgComposer *composer)
        if (source) {
                EComposerHeader *composer_header;
                const gchar *name = NULL, *address = NULL;
+               gboolean is_from_override = FALSE;
 
                composer_header = e_composer_header_table_get_header (header_table, E_COMPOSER_HEADER_FROM);
                if (e_composer_from_header_get_override_visible (E_COMPOSER_FROM_HEADER (composer_header))) {
                        name = e_composer_header_table_get_from_name (header_table);
                        address = e_composer_header_table_get_from_address (header_table);
 
-                       if (address && !*address)
+                       if (address && !*address) {
+                               name = NULL;
                                address = NULL;
+                       }
+
+                       is_from_override = address != NULL;
                }
 
                if (!address) {
@@ -130,7 +135,7 @@ composer_to_meeting_component (EMsgComposer *composer)
                                address = alias_address;
                }
 
-               if (!address || !name || !*name) {
+               if (!is_from_override && (!address || !name || !*name)) {
                        ESourceMailIdentity *mail_identity;
 
                        mail_identity = e_source_get_extension (source, E_SOURCE_EXTENSION_MAIL_IDENTITY);


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