aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/google-account-setup/ChangeLog7
-rw-r--r--plugins/google-account-setup/google-source.c17
2 files changed, 23 insertions, 1 deletions
diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog
index 325cd83a42..91381d897d 100644
--- a/plugins/google-account-setup/ChangeLog
+++ b/plugins/google-account-setup/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-23 Nyall <nyall@zombiepigs.net>
+
+ ** Fix for bug #503954
+
+ * google-source.c: (is_email), (user_changed): Accept custom domain
+ names while setting up account.
+
2007-10-30 Sankar P <psankar@novell.com>
* ChangeLog:
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index f20d6d7209..907aad3d57 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -154,6 +154,21 @@ ssl_changed (GtkToggleButton *button, ESource *source)
#endif
+static gboolean
+is_email (const char *address)
+{
+ /* This is supposed to check if the address's domain could be
+ an FQDN but alas, it's not worth the pain and suffering. */
+ const char *at;
+
+ at = strchr (address, '@');
+ /* make sure we have an '@' and that it's not the first or last char */
+ if (!at || at == address || *(at + 1) == '\0')
+ return FALSE;
+
+ return TRUE;
+}
+
static void
user_changed (GtkEntry *editable, ESource *source)
{
@@ -183,7 +198,7 @@ user_changed (GtkEntry *editable, ESource *source)
projection = g_strdup ("/private/full");
- if (!g_str_has_suffix (user, "gmail.com\0")) {
+ if (!is_email (user)) {
user = g_strconcat (user, "@gmail.com", NULL);
}