aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-03-25 00:25:29 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-03-25 00:25:29 +0800
commit8c4efd8788c3cbf665860ba990775457022a51a4 (patch)
tree7b17b2833a53286e8b55aafa8bce0b02d6861108 /mail/mail-config.c
parent75299a2f99e7920edfc914f44bc850dc397ff9e1 (diff)
downloadgsoc2013-evolution-8c4efd8788c3cbf665860ba990775457022a51a4.tar.gz
gsoc2013-evolution-8c4efd8788c3cbf665860ba990775457022a51a4.tar.zst
gsoc2013-evolution-8c4efd8788c3cbf665860ba990775457022a51a4.zip
** Fix for bug #552583
2009-03-24 Milan Crha <mcrha@redhat.com> ** Fix for bug #552583 * mail-config.c: (only_username), (mail_config_account_url_equal): Compare only user names, without a domain part, if such exists. svn path=/trunk/; revision=37471
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 42278be368..53a72e09a1 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -800,6 +800,19 @@ mail_config_get_account_by_uid (const char *uid)
return (EAccount *) e_account_list_find (config->accounts, E_ACCOUNT_FIND_UID, uid);
}
+static const char *
+only_username (const char *str)
+{
+ if (str) {
+ const char *p = strpbrk (str, "\\/");
+
+ if (p)
+ str = p + 1;
+ }
+
+ return str;
+}
+
static gboolean
mail_config_account_url_equal (const CamelURL *u1,
const CamelURL *u2)
@@ -810,7 +823,7 @@ mail_config_account_url_equal (const CamelURL *u1,
if (g_strcmp0 (u1->protocol, u2->protocol) != 0)
return FALSE;
- if (g_strcmp0 (u1->user, u2->user) != 0)
+ if (g_strcmp0 (only_username (u1->user), only_username (u2->user)) != 0)
return FALSE;
if (g_strcmp0 (u1->host, u2->host) != 0)