[evolution-couchdb] Set the ID for the contact we send back from the CouchDB server generated one



commit 48cd8f13bc2026e860d0d8ac6d253b94a9914b3b
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Jun 24 12:52:56 2009 +0200

    Set the ID for the contact we send back from the CouchDB server generated one

 addressbook/e-book-backend-couchdb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index 8f5ad6e..f838716 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -256,9 +256,10 @@ e_book_backend_couchdb_create_contact (EBookBackend *backend,
 	}
 
 	/* save the contact into the DB */
-	if (couchdb_document_put (document, couchdb_backend->dbname, &error))
+	if (couchdb_document_put (document, couchdb_backend->dbname, &error)) {
+		e_contact_set (contact, E_CONTACT_UID, (const gpointer) couchdb_document_get_id (document));
 		e_data_book_respond_create (book, opid, GNOME_Evolution_Addressbook_Success, contact);
-	else
+	} else
 		e_data_book_respond_create (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
 
 	/* free memory */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]