From a0be52e0563f6f0ce1c4a29d8b361495a3b46f4e Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Sun, 23 Dec 2007 09:37:14 +0000 Subject: Patch from Nyall : Fix for bug #503954 (Accept custom domain names while setting up a Google Calendar account) svn path=/trunk/; revision=34732 --- plugins/google-account-setup/ChangeLog | 7 +++++++ plugins/google-account-setup/google-source.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'plugins/google-account-setup') 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 + + ** Fix for bug #503954 + + * google-source.c: (is_email), (user_changed): Accept custom domain + names while setting up account. + 2007-10-30 Sankar P * 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); } -- cgit