Modify contact sync operation.
authorKeebum Kim <keebum.kim@samsung.com>
Wed, 5 Jun 2013 07:10:37 +0000 (16:10 +0900)
committerKeebum Kim <keebum.kim@samsung.com>
Wed, 5 Jun 2013 07:10:37 +0000 (16:10 +0900)
Change-Id: Iad0e530d46dcb8beaedd7cd3ca5fc5ec4c69b01d

utils/MsgContact.cpp

index 5b75e67..f9533c3 100755 (executable)
@@ -454,33 +454,27 @@ bool MsgUpdateContact(int index, int type)
        ret = contacts_record_get_child_record_at_p(contact, _contacts_contact.name, 0, &name);
        if (ret != CONTACTS_ERROR_NONE) {
                MSG_DEBUG("contacts_record_get_child_record_at_p() Error [%d]", ret);
-               contacts_record_destroy(contact, true);
-               return false;
-       }
-
-       char* strFirstName = NULL;
-       ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName);
-       if (ret != CONTACTS_ERROR_NONE) {
-               MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
-               contacts_record_destroy(contact, true);
-               return false;
-       }
+       } else {
+               char* strFirstName = NULL;
+               ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName);
+               if (ret != CONTACTS_ERROR_NONE) {
+                       MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+               }
 
-       char* strLastName = NULL;
-       ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName);
-       if (ret != CONTACTS_ERROR_NONE) {
-               MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
-               contacts_record_destroy(contact, true);
-               return false;
-       }
+               char* strLastName = NULL;
+               ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName);
+               if (ret != CONTACTS_ERROR_NONE) {
+                       MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+               }
 
-       MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName);
+               MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName);
 
-       if (strFirstName != NULL)
-               strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
+               if (strFirstName != NULL)
+                       strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
 
-       if (strLastName != NULL)
-               strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+               if (strLastName != NULL)
+                       strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+       }
 
        MsgStoClearContactInfo(&ContactDbHandle, index);