On wizard, if username has @, don't add provider address in email address. Fixes...
authorJose Dapena Paz <jdapena@igalia.com>
Mon, 29 Jun 2009 14:03:02 +0000 (16:03 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Mon, 29 Jun 2009 14:17:39 +0000 (16:17 +0200)
src/hildon2/modest-easysetup-wizard-dialog.c

index c824802..611d5cf 100644 (file)
@@ -608,12 +608,19 @@ on_user_username_changed(GtkWidget* widget, ModestEasysetupWizardDialog *self)
                MODEST_PROVIDER_PICKER (priv->account_serviceprovider_picker));
 
        if (provider_id) {
                MODEST_PROVIDER_PICKER (priv->account_serviceprovider_picker));
 
        if (provider_id) {
+               const gchar *current_username;
                gchar *email_address;
                gchar *domain_name = modest_presets_get_domain (priv->presets, provider_id);
 
                gchar *email_address;
                gchar *domain_name = modest_presets_get_domain (priv->presets, provider_id);
 
-               email_address = g_strdup_printf ("%s@%s",
-                                                hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username)),
-                                                domain_name);
+               current_username = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username));
+
+               if (current_username && strstr (current_username, "@")) {
+                       email_address = g_strdup (current_username);
+               } else {
+                       email_address = g_strdup_printf ("%s@%s",
+                                                        current_username,
+                                                        domain_name);
+               }
 
                /* Update the email address */
                hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), email_address);
 
                /* Update the email address */
                hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), email_address);