pMsgList->msg_struct_info = NULL;
int rowCnt = 0;
- int index = 26; // numbers of index
+ int index = 19; // numbers of index
unsigned int tmpSize = 0;
char sqlQuery[maxQuerySize];
- char firstName[MAX_DISPLAY_NAME_LEN+1], lastName[MAX_DISPLAY_NAME_LEN+1];
- char displayName[MAX_DISPLAY_NAME_LEN+1];
-
char *ext1_str = NULL;
char *ext2_str = NULL;
char *ext3_str = NULL;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.CONV_ID, A.FOLDER_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, "
- "A.DISPLAY_TIME, A.DATA_SIZE, A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, "
- "A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, B.ADDRESS_TYPE, B.RECIPIENT_TYPE, "
- "B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.ATTACHMENT_COUNT, A.THUMB_PATH "
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT "
+ "A.MSG_ID, "
+ "A.CONV_ID, "
+ "A.FOLDER_ID, "
+ "A.STORAGE_ID, "
+ "A.MAIN_TYPE, "
+ "A.SUB_TYPE, "
+ "A.DISPLAY_TIME, "
+ "A.DATA_SIZE, "
+ "A.NETWORK_STATUS, "
+ "A.READ_STATUS, "
+ "A.PROTECTED, "
+ "A.BACKUP, "
+ "A.PRIORITY, "
+ "A.MSG_DIRECTION, "
+ "A.SCHEDULED_TIME, "
+ "A.SUBJECT, "
+ "A.MSG_TEXT, "
+ "A.ATTACHMENT_COUNT, "
+ "A.THUMB_PATH "
"FROM %s A, %s B WHERE A.CONV_ID = B.CONV_ID AND B.ADDRESS_ID <> 0 ",
MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME);
}
msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
- msg_struct_s *addr_info = NULL;
- MSG_ADDRESS_INFO_S *address = NULL;
-
- addr_list->nCount = 1;
- addr_list->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t *)*MAX_TO_ADDRESS_CNT];
-
- msg_struct_s *pTmpAddr = NULL;
-
- for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
- addr_list->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
- pTmpAddr = (msg_struct_s *)addr_list->msg_struct_info[i];
- pTmpAddr->type = MSG_STRUCT_ADDRESS_INFO;
- pTmpAddr->data = new MSG_ADDRESS_INFO_S;
- memset(pTmpAddr->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
-
- addr_list->msg_struct_info[i] = (msg_struct_t)pTmpAddr;
- }
-
- addr_info = (msg_struct_s *)addr_list->msg_struct_info[0];
- address = (MSG_ADDRESS_INFO_S *)addr_info->data;
- address->addressType = dbHandle.getColumnToInt(index++);
- address->recipientType = dbHandle.getColumnToInt(index++);
- address->contactId = dbHandle.getColumnToInt(index++);
-
- dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, address->addressVal);
-
- memset(displayName, 0x00, sizeof(displayName));
- dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, displayName);
-
- memset(firstName, 0x00, sizeof(firstName));
- dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, firstName);
- memset(lastName, 0x00, sizeof(lastName));
- dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, lastName);
-
- if (strlen(displayName) <= 0) {
- if (order == 0) {
- if (firstName[0] != '\0') {
- strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
- }
-
- if (lastName[0] != '\0') {
- strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
- strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
- }
- } else if (order == 1) {
- if (lastName[0] != '\0') {
- strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
- strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
- }
-
- if (firstName[0] != '\0') {
- strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
- }
- }
- }
-
- strncpy(address->displayName, displayName, MAX_DISPLAY_NAME_LEN);
+ MsgStoGetAddressByMsgId(&dbHandle, pTmp->msgId, order, addr_list);
pTmp->addr_list = addr_list;