From 1804eef2276a094e10259a59aa21ee74efd13f77 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Tue, 18 Jul 2006 11:12:37 +0000 Subject: Finish up fixing for new API (#313533). 2006-07-18 Ross Burton * backends/ldap/e-book-backend-ldap.c: Finish up fixing for new API (#313533). --- addressbook/ChangeLog | 7 ++++++- addressbook/backends/ldap/e-book-backend-ldap.c | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index fc335823a..9c8e7e839 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,4 +1,9 @@ -2006-07-17 Sushma Rai +2006-07-18 Ross Burton + + * backends/ldap/e-book-backend-ldap.c: + Finish up fixing for new API (#313533). + +2006-07-17 Sushma Rai backends/ldap/e-book-backend-ldap.c: Incorporating the EContactPhoto Changes, so that e-d-s build doesn't break. See #313533. diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c index c9496fd44..1499db001 100644 --- a/addressbook/backends/ldap/e-book-backend-ldap.c +++ b/addressbook/backends/ldap/e-book-backend-ldap.c @@ -3139,6 +3139,8 @@ photo_populate (EContact *contact, struct berval **ber_values) { if (ber_values && ber_values[0]) { EContactPhoto photo; + photo.type = E_CONTACT_PHOTO_TYPE_INLINED; + photo.data.inlined.mime_type = NULL; photo.data.inlined.data = ber_values[0]->bv_val; photo.data.inlined.length = ber_values[0]->bv_len; @@ -3153,7 +3155,7 @@ photo_ber (EContact *contact) EContactPhoto *photo; photo = e_contact_get(contact, E_CONTACT_PHOTO); - if (photo) { + if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { result = g_new(struct berval *, 2); result[0] = g_new(struct berval, 1); @@ -3179,8 +3181,16 @@ photo_compare(EContact * ecard1, EContact * ecard2) if (photo1 && photo2) { - equal = ((photo1->data.inlined.length == photo2->data.inlined.length) - && !memcmp (photo1->data.inlined.data, photo2->data.inlined.data, photo1->data.inlined.length)); + if (photo1->type == photo2->type && photo1->type == E_CONTACT_PHOTO_TYPE_INLINED) { + equal = ((photo1->data.inlined.length == photo2->data.inlined.length) + && !memcmp (photo1->data.inlined.data, photo2->data.inlined.data, photo1->data.inlined.length)); + } else if (photo1->type == photo2->type && photo1->type == E_CONTACT_PHOTO_TYPE_URI) { + + equal = !strcmp (photo1->data.uri, photo2->data.uri); + } else { + equal = FALSE; + } + } else { equal = (!!photo1 == !!photo2); -- cgit v1.2.1