MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
}
+ char* strDisplayName = NULL;
+ ret = contacts_record_get_str_p(contact, _contacts_contact.display_name, &strDisplayName);
+ if (ret != CONTACTS_ERROR_NONE) {
+ MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+ }
+
if (strFirstName != NULL)
strncpy(pContactInfo->firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
if (strLastName != NULL)
strncpy(pContactInfo->lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+
+ if (strDisplayName != NULL)
+ strncpy(pContactInfo->displayName, strDisplayName, MAX_DISPLAY_NAME_LEN);
}
MSG_DEBUG("pContactInfo->firstName : [%s], pContactInfo->lastName : [%s]", pContactInfo->firstName, pContactInfo->lastName);
+ MSG_DEBUG("pContactInfo->displayName : [%s]", pContactInfo->displayName);
ret = contacts_record_get_int(contact, _contacts_contact.id, (int*)&pContactInfo->contactId);
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);
+ char* strDisplayName = NULL;
+ ret = contacts_record_get_str_p(contact, _contacts_contact.display_name, &strDisplayName);
+ if (ret != CONTACTS_ERROR_NONE) {
+ MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+ }
if (strFirstName != NULL)
strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
if (strLastName != NULL)
strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+
+ if (strDisplayName != NULL)
+ strncpy(contactInfo.displayName, strDisplayName, MAX_DISPLAY_NAME_LEN);
+
+ MSG_DEBUG("First Name : [%s], Last Name : [%s]", contactInfo.firstName, contactInfo.lastName);
+ MSG_DEBUG("displayName : [%s]", contactInfo.displayName);
}
MsgStoClearContactInfo(&ContactDbHandle, index);
// Add Address
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s', %d, '', ?, ?, '%s', 0);",
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s', %d, ?, ?, ?, '%s', 0);",
MSGFW_ADDRESS_TABLE_NAME, addrId, *pConvId, pMsg->addressList[i].addressType, pMsg->addressList[i].recipientType, pMsg->addressList[i].addressVal,
contactInfo.contactId, contactInfo.imagePath);
if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_PREPARE;
- pDbHandle->bindText(contactInfo.firstName, 1);
- pDbHandle->bindText(contactInfo.lastName, 2);
+ pDbHandle->bindText(contactInfo.displayName, 1);
+ pDbHandle->bindText(contactInfo.firstName, 2);
+ pDbHandle->bindText(contactInfo.lastName, 3);
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
pDbHandle->finalizeQuery();
char sqlQuery[MAX_QUERY_LEN+1];
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
- CONTACT_ID = %d, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
- WHERE ADDRESS_VAL = '%s';",
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET "
+ "CONTACT_ID = %d, "
+ "DISPLAY_NAME = ?, "
+ "FIRST_NAME = ?, "
+ "LAST_NAME = ?, "
+ "IMAGE_PATH = '%s' "
+ "WHERE ADDRESS_VAL = '%s';",
MSGFW_ADDRESS_TABLE_NAME, pContactInfo->contactId, pContactInfo->imagePath, pNumber);
if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_PREPARE;
}
- pDbHandle->bindText(pContactInfo->firstName, 1);
-
- pDbHandle->bindText(pContactInfo->lastName, 2);
+ pDbHandle->bindText(pContactInfo->displayName, 1);
+ pDbHandle->bindText(pContactInfo->firstName, 2);
+ pDbHandle->bindText(pContactInfo->lastName, 3);
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
pDbHandle->finalizeQuery();