diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2007-12-23 17:37:14 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2007-12-23 17:37:14 +0800 |
commit | a0be52e0563f6f0ce1c4a29d8b361495a3b46f4e (patch) | |
tree | f620ab6fb382fc201589021a0d19c9837630a664 /plugins | |
parent | a05d5cff0da1483bcc93caac40484fb991d53416 (diff) | |
download | gsoc2013-evolution-a0be52e0563f6f0ce1c4a29d8b361495a3b46f4e.tar.gz gsoc2013-evolution-a0be52e0563f6f0ce1c4a29d8b361495a3b46f4e.tar.zst gsoc2013-evolution-a0be52e0563f6f0ce1c4a29d8b361495a3b46f4e.zip |
Patch from Nyall <nyall@zombiepigs.net>: Fix for bug #503954 (Accept custom domain names while setting up a Google Calendar account)
svn path=/trunk/; revision=34732
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/google-account-setup/ChangeLog | 7 | ||||
-rw-r--r-- | plugins/google-account-setup/google-source.c | 17 |
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); } |