Conversation::Conversation(unsigned int threadId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (msgType == EMAIL)
{
Conversation::Conversation(std::string threadId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bool result = FALSE;
std::istringstream stream(threadId);
- LogDebug("threadId : " << threadId);
+ LoggerD("threadId : " << threadId);
unsigned int number = 0;
stream >> number;
//void Conversation::makeConversationFromThread(msg_thread_view_t msg_thread)
void Conversation::makeConversationFromThread(msg_struct_t msg_thread)
{
- LogDebug("Enter");
+ LoggerD("Enter");
msg_handle_t handle = MsgGetCommonHandle();
msg_struct_list_s convViewList;
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
msg_struct_t msgInfo = NULL;
msg_struct_t sendOpt = NULL;
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
}
if (tempString != NULL)
{
m_preview = tempString;
- LogDebug("preview" << m_preview);
+ LoggerD("preview" << m_preview);
}
err = msg_get_conversation_view_list(handle, m_Id, &convViewList);
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_DIRECTION_INT, &tempInt);
int type = tempInt;
- msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
- nToCnt = addr_list->nCount;
+ nToCnt = msg_list_length(addr_list);
if (type == MSG_DIRECTION_TYPE_MT)
{
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[m_lastMessageId], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, m_lastMessageId);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
if (strNumber[0] != '\0')
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
}
// get thread subject
for (index = 0; index < nToCnt; index++)
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[index], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
tempString = strNumber;
if (tempString != NULL)
{
}
else
{
- LogDebug("address fetch fail" << addressCount);
+ LoggerD("address fetch fail" << addressCount);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
msg_release_list_struct(&convViewList);
void Conversation::makeConversationFromThreadIndex(unsigned int threadIndex)
{
/*
- LogDebug("Enter");
+ LoggerD("Enter");
MSG_HANDLE_T handle = MsgGetCommonHandle();
MSG_LIST_S convViewList = {0, NULL};
MSG_THREAD_VIEW_LIST_S threadViewList = {0, NULL};
if (threadViewList.nCount < 0 || threadIndex >= (unsigned int)threadViewList.nCount)
{
- LogDebug(threadIndex << ":" << threadViewList.nCount);
+ LoggerD(threadIndex << ":" << threadViewList.nCount);
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "invalid index reference" );
}
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
// default:
// Todo email / chat
if (tempString != NULL)
{
m_preview = tempString;
- LogDebug("preview" << m_preview);
+ LoggerD("preview" << m_preview);
}
m_messageCount = convViewList.nCount;
m_read = msg_is_read(convViewList.msgInfo[lastMsgIndex]);
- LogDebug("lastMsgIndex:" << lastMsgIndex << ",message count:" << m_messageCount << ",read" << m_read);
+ LoggerD("lastMsgIndex:" << lastMsgIndex << ",message count:" << m_messageCount << ",read" << m_read);
if (msg_get_direction_info(convViewList.msgInfo[lastMsgIndex]) == MSG_DIRECTION_TYPE_MT)
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
- LogDebug("from" << m_from);
+ LoggerD("from" << m_from);
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
}
m_subject = tempString;
}
- LogDebug("subject" << m_subject);
+ LoggerD("subject" << m_subject);
addressCount = msg_get_address_count(convViewList.msgInfo[lastMsgIndex]);
m_to.push_back(tempString);
}
}
- LogDebug("address count" << addressCount);
+ LoggerD("address count" << addressCount);
}
else
{
- LogDebug("address fetch fail" << addressCount);
+ LoggerD("address fetch fail" << addressCount);
}
if (msg_get_message_id(convViewList.msgInfo[lastMsgIndex]) >= 0 )
m_lastMessageId = msg_get_message_id(convViewList.msgInfo[lastMsgIndex]);
}
- LogDebug("message id" << m_lastMessageId);
+ LoggerD("message id" << m_lastMessageId);
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
if (convViewList.msgInfo != NULL)
{
bool Conversation::makeConversationFromMsgId(unsigned int msgId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
msg_handle_t handle = MsgGetCommonHandle();
msg_struct_t msg_thread = NULL;
msg_struct_list_s convViewList;
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
msg_error_t err = MSG_SUCCESS;
// get threadId from message
msg_get_int_value(msgInfo, MSG_MESSAGE_THREAD_ID_INT, &tempInt);
m_Id = (unsigned int)tempInt;
- LogDebug("m_Id : " << m_Id);
+ LoggerD("m_Id : " << m_Id);
// get Thread
msg_thread = msg_create_struct(MSG_STRUCT_THREAD_INFO);
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
}
// get thread time
msg_get_int_value(msg_thread, MSG_THREAD_MSG_TIME_INT, &tempInt);
m_time = tempInt;
- LogDebug("m_time : " << m_time);
+ LoggerD("m_time : " << m_time);
// get thread unread count
msg_get_int_value(msg_thread, MSG_THREAD_UNREAD_COUNT_INT, &tempInt);
m_unreadMessages = tempInt;
- LogDebug("m_unreadMessages : " << m_unreadMessages);
+ LoggerD("m_unreadMessages : " << m_unreadMessages);
// get thread preview
msg_get_str_value(msg_thread, MSG_THREAD_MSG_DATA_STR, msgData, MAX_THREAD_DATA_LEN);
{
m_preview = tempString;
}
- LogDebug("m_preview : " << m_preview);
+ LoggerD("m_preview : " << m_preview);
err = msg_get_conversation_view_list(handle, m_Id, &convViewList);
// get thread message count
lastMsgIndex = convViewList.nCount - 1;
m_messageCount = convViewList.nCount;
- LogDebug("m_messageCount : " << m_messageCount);
+ LoggerD("m_messageCount : " << m_messageCount);
// get thread read status
msg_get_bool_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_READ_BOOL, &tempBool);
m_read = tempBool;
- LogDebug("m_read : " << m_read);
+ LoggerD("m_read : " << m_read);
// get thread last message Id
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_ID_INT, &tempInt);
m_lastMessageId = tempInt;
- LogDebug("m_lastMessageId : " << m_lastMessageId);
+ LoggerD("m_lastMessageId : " << m_lastMessageId);
// get thread from
if (msg_get_message(handle, m_lastMessageId, msgInfo, sendOpt) != MSG_SUCCESS)
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_DIRECTION_INT, &tempInt);
int type = tempInt;
- LogDebug("direction : " << type);
+ LoggerD("direction : " << type);
- msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- nToCnt = addr_list->nCount;
+ msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+ nToCnt = msg_list_length(addr_list);
if (type == MSG_DIRECTION_TYPE_MT)
{
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[nToCnt-1], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, nToCnt-1);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
if (strNumber[0] != '\0')
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
// get thread to
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
for (int index = 0; index < nToCnt; index++)
{
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[index], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
tempString = strNumber;
if (tempString != NULL)
{
- LogDebug("m_to : " << tempString);
+ LoggerD("m_to : " << tempString);
m_to.push_back(tempString);
}
}
}
else
{
- LogDebug("address fetch fail");
+ LoggerD("address fetch fail");
}
}
{
m_subject = tempString; // convert char to string
}
- LogDebug("m_subject : " << m_subject);
+ LoggerD("m_subject : " << m_subject);
}
catch (const WrtDeviceApis::Commons::UnknownException& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
msg_release_list_struct(&convViewList);
bool Conversation::makeConversationFromEmailThreadId(unsigned int emailTreadId)
{
- LogDebug("Enter");
+ LoggerD("Enter");
email_mail_list_item_t *resultMail = NULL;
email_mail_list_item_t *mailList = NULL;
// account Id
m_unreadMessages = 0;
- LogDebug("start email_get_mail_list");
+ LoggerD("start email_get_mail_list");
if (email_get_mail_list(mailData->account_id, 0, emailTreadId, 0, resultMail->thread_item_count,
EMAIL_SORT_DATETIME_HIGH, &mailList, &count) != EMAIL_ERROR_NONE)
{
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get email data fail" );
}
- LogDebug("end email_get_mail_list");
+ LoggerD("end email_get_mail_list");
// unread msg count
for (index = 0; index < count; index++)
{
m_unreadMessages++;
}
- LogDebug(mailList[index].flags_seen_field);
+ LoggerD(mailList[index].flags_seen_field);
}
// message count
if (resultMail->full_address_from[0] != '\0')
{
m_from = resultMail->full_address_from;
- LogDebug(m_from);
+ LoggerD(m_from);
}
// subject
if (resultMail->subject[0] != '\0')
{
m_subject = resultMail->subject;
- LogDebug(m_subject);
+ LoggerD(m_subject);
}
if (mailData->full_address_to != NULL)
{
- LogDebug("Header To " << mailData->full_address_to);
+ LoggerD("Header To " << mailData->full_address_to);
m_to.push_back(mailData->full_address_to);
}
if (mailData->full_address_bcc != NULL)
{
- LogDebug("Header Bcc " << mailData->full_address_bcc);
+ LoggerD("Header Bcc " << mailData->full_address_bcc);
m_bcc.push_back(mailData->full_address_bcc);
}
if (mailData->full_address_cc != NULL)
{
- LogDebug("Header CC " << mailData->full_address_cc);
+ LoggerD("Header CC " << mailData->full_address_cc);
m_cc.push_back(mailData->full_address_cc);
}
m_lastMessageId = resultMail->mail_id;
- LogDebug(m_lastMessageId);
+ LoggerD(m_lastMessageId);
m_result = true;
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
if (mailData != NULL)
}
}
+