Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-exchange-2.6
fix-crash-ee-ense-edit.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-crash-ee-ense-edit.diff of Package evolution-exchange-2.6
Index: addressbook/e-book-backend-exchange.c =================================================================== RCS file: /cvs/gnome/evolution-exchange/addressbook/e-book-backend-exchange.c,v retrieving revision 1.56 diff -u -p -r1.56 e-book-backend-exchange.c --- addressbook/e-book-backend-exchange.c 24 Jul 2006 10:53:36 -0000 1.56 +++ addressbook/e-book-backend-exchange.c 19 Dec 2006 17:54:16 -0000 @@ -2110,7 +2110,10 @@ e_book_backend_exchange_get_contact (EBo EBookBackendExchange *be = E_BOOK_BACKEND_EXCHANGE (backend); EBookBackendExchangePrivate *bepriv = be->priv; EContact *contact; - + E2kResult *results; + E2kHTTPStatus status; + int nresults = 0; + d(printf("ebbe_get_contact(%p, %p, %s)\n", backend, book, id)); be = E_BOOK_BACKEND_EXCHANGE (e_data_book_get_backend (book)); @@ -2132,7 +2135,44 @@ e_book_backend_exchange_get_contact (EBo } case GNOME_Evolution_Addressbook_MODE_REMOTE: - /* XXX finish this */ + + if (bepriv->marked_for_offline && e_book_backend_cache_is_populated (bepriv->cache)) { + contact = e_book_backend_cache_get_contact (bepriv->cache, + id); + if (contact) { + *vcard = e_vcard_to_string (E_VCARD (contact), + EVC_FORMAT_VCARD_30); + g_object_unref (contact); + return GNOME_Evolution_Addressbook_Success; + } + else { + *vcard = g_strdup (""); + return GNOME_Evolution_Addressbook_ContactNotFound; + } + + } else { + status = e2k_context_propfind (bepriv->ctx, NULL, id, + field_names, n_field_names, + &results, &nresults); + + if (status == E2K_HTTP_CANCELLED) + return GNOME_Evolution_Addressbook_OtherError; + + if (status == E2K_HTTP_MULTI_STATUS && nresults > 0) { + contact = e_contact_from_props (be, &results[0]); + *vcard = e_vcard_to_string (E_VCARD (contact), + EVC_FORMAT_VCARD_30); + g_object_unref (contact); + e2k_results_free (results, nresults); + + return GNOME_Evolution_Addressbook_Success; + + } else { + *vcard = g_strdup (""); + + return GNOME_Evolution_Addressbook_ContactNotFound; + } + } default: break;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor