[evolution-ews] ConfigLookup: Change values saved to the lookup result



commit e43bd48dae57b7643c44aa69d8b3381626a886ce
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 23 13:06:45 2021 +0200

    ConfigLookup: Change values saved to the lookup result
    
    Two changes:
    - use full email address as the user name
    - set the email address also to the settings

 src/EWS/evolution/e-ews-config-lookup.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/src/EWS/evolution/e-ews-config-lookup.c b/src/EWS/evolution/e-ews-config-lookup.c
index 3eb1d656..90a4d171 100644
--- a/src/EWS/evolution/e-ews-config-lookup.c
+++ b/src/EWS/evolution/e-ews-config-lookup.c
@@ -194,30 +194,17 @@ ews_config_lookup_worker_result_from_data (EConfigLookup *config_lookup,
        if (hosturl && *hosturl) {
                EConfigLookupResult *lookup_result;
                GString *description;
-               gchar *tmp, *ptr, *user;
                const gchar *extension_name;
                SoupURI *suri;
 
                extension_name = e_source_camel_get_extension_name ("ews");
 
-               tmp = g_strdup (email_address);
-               ptr = tmp ? strchr (tmp, '@') : NULL;
-               if (ptr)
-                       *ptr = '\0';
-
-               if (!tmp || !*tmp) {
-                       g_free (tmp);
-                       tmp = NULL;
-               }
-
-               user = tmp;
-
                suri = soup_uri_new (hosturl);
 
                description = g_string_new ("");
 
-               if (user && *user)
-                       g_string_append_printf (description, _("User: %s"), user);
+               if (email_address && *email_address)
+                       g_string_append_printf (description, _("User: %s"), email_address);
 
                if (description->len)
                        g_string_append_c (description, '\n');
@@ -247,14 +234,19 @@ ews_config_lookup_worker_result_from_data (EConfigLookup *config_lookup,
                e_config_lookup_result_simple_add_string (lookup_result, extension_name,
                        "oaburl", oaburl);
 
-               if (user && *user) {
+               if (email_address && *email_address) {
+                       e_config_lookup_result_simple_add_string (lookup_result, extension_name,
+                               "email", email_address);
+               }
+
+               if (email_address && *email_address) {
                        e_config_lookup_result_simple_add_string (lookup_result,
                                E_SOURCE_EXTENSION_COLLECTION,
-                               "identity", user);
+                               "identity", email_address);
 
                        e_config_lookup_result_simple_add_string (lookup_result,
                                E_SOURCE_EXTENSION_AUTHENTICATION,
-                               "user", user);
+                               "user", email_address);
                }
 
                if (suri && suri->host && *suri->host) {
@@ -272,7 +264,6 @@ ews_config_lookup_worker_result_from_data (EConfigLookup *config_lookup,
                e_config_lookup_add_result (config_lookup, lookup_result);
 
                g_string_free (description, TRUE);
-               g_free (user);
                if (suri)
                        soup_uri_free (suri);
        }


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