[evolution-data-server/gnome-3-18] Bug 760951 - Cannot copy contact from Google to WebDAV addressbook
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-18] Bug 760951 - Cannot copy contact from Google to WebDAV addressbook
- Date: Thu, 11 Feb 2016 17:43:54 +0000 (UTC)
commit 61cb6e7aa60dda6ed795ba491735732341b73f69
Author: Milan Crha <mcrha redhat com>
Date: Thu Feb 11 18:37:29 2016 +0100
Bug 760951 - Cannot copy contact from Google to WebDAV addressbook
.../backends/webdav/e-book-backend-webdav.c | 23 +++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c
b/addressbook/backends/webdav/e-book-backend-webdav.c
index b84cc6d..bcfc6fc 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -1458,6 +1458,27 @@ book_backend_webdav_open_sync (EBookBackend *backend,
}
static gboolean
+webdav_can_use_uid (const gchar *uid)
+{
+ const gchar *ptr;
+
+ if (!uid || !*uid)
+ return FALSE;
+
+ for (ptr = uid; *ptr; ptr++) {
+ if ((*ptr >= 'a' && *ptr <= 'z') ||
+ (*ptr >= 'A' && *ptr <= 'Z') ||
+ (*ptr >= '0' && *ptr <= '9') ||
+ strchr (".-@", *ptr) != NULL)
+ continue;
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
book_backend_webdav_create_contacts_sync (EBookBackend *backend,
const gchar * const *vcards,
GQueue *out_contacts,
@@ -1495,7 +1516,7 @@ book_backend_webdav_create_contacts_sync (EBookBackend *backend,
contact = e_contact_new_from_vcard (vcards[0]);
orig_uid = e_contact_get_const (contact, E_CONTACT_UID);
- if (orig_uid && *orig_uid && !e_book_backend_cache_check_contact (webdav->priv->cache, orig_uid)) {
+ if (orig_uid && *orig_uid && webdav_can_use_uid (orig_uid) && !e_book_backend_cache_check_contact
(webdav->priv->cache, orig_uid)) {
uid = g_strdup (orig_uid);
} else {
uid = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]