summaryrefslogtreecommitdiff
path: root/utils/MsgUtilStorage.cpp
diff options
context:
space:
mode:
authorSangkoo Kim <sangkoo.kim@samsung.com>2012-10-11 14:53:44 +0900
committerSangkoo Kim <sangkoo.kim@samsung.com>2012-10-11 14:53:44 +0900
commit398fc088a6819f5cb914c10a4d202312231448b9 (patch)
tree52a25f29061a9ace83699c7a9d3df8f735fa3b20 /utils/MsgUtilStorage.cpp
parentabc6c8642e18cc66b8fff2c048c2cedce95d484c (diff)
downloadmsg-service-398fc088a6819f5cb914c10a4d202312231448b9.tar.gz
msg-service-398fc088a6819f5cb914c10a4d202312231448b9.tar.bz2
msg-service-398fc088a6819f5cb914c10a4d202312231448b9.zip
Apply new contacts-service db.
Change-Id: Ib735f9f3ab666b75a678c23cf4027cebd29efd7b
Diffstat (limited to 'utils/MsgUtilStorage.cpp')
-rwxr-xr-xutils/MsgUtilStorage.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/utils/MsgUtilStorage.cpp b/utils/MsgUtilStorage.cpp
index 525e41b..a5aaccc 100755
--- a/utils/MsgUtilStorage.cpp
+++ b/utils/MsgUtilStorage.cpp
@@ -375,7 +375,7 @@ msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *
// 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);
@@ -384,9 +384,8 @@ msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *
if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_PREPARE;
- pDbHandle->bindText(contactInfo.displayName, 1);
- pDbHandle->bindText(contactInfo.firstName, 2);
- pDbHandle->bindText(contactInfo.lastName, 3);
+ pDbHandle->bindText(contactInfo.firstName, 1);
+ pDbHandle->bindText(contactInfo.lastName, 2);
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
pDbHandle->finalizeQuery();
@@ -1032,13 +1031,13 @@ msg_error_t MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pC
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
- CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
+ CONTACT_ID = %d, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
WHERE ADDRESS_VAL LIKE '%%%%%s';",
MSGFW_ADDRESS_TABLE_NAME, pContactInfo->contactId, pContactInfo->imagePath, newPhoneNum);
} else {
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
- CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
+ CONTACT_ID = %d, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
WHERE ADDRESS_VAL = '%s';",
MSGFW_ADDRESS_TABLE_NAME, pContactInfo->contactId, pContactInfo->imagePath, pNumber);
}
@@ -1046,11 +1045,9 @@ msg_error_t MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pC
if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_PREPARE;
- pDbHandle->bindText(pContactInfo->displayName, 1);
+ pDbHandle->bindText(pContactInfo->firstName, 1);
- pDbHandle->bindText(pContactInfo->firstName, 2);
-
- pDbHandle->bindText(pContactInfo->lastName, 3);
+ pDbHandle->bindText(pContactInfo->lastName, 2);
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
pDbHandle->finalizeQuery();