📄 jpushinboxum.c
字号:
}
}
}
/*****************************************************************************
* FUNCTION
* mmi_um_brw_delete_all_messages_rsp
* DESCRIPTION
* Function to recieve information that if user has confirmed
* to delete all push messages or not.
* PARAMETERS
* msg_delete_all_rsp [?] - confirmation of deletion of all messages.
* RETURNS
* void
*****************************************************************************/
void mmi_um_brw_delete_all_messages_rsp(void *msg_delete_all_rsp)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
mmi_um_delete_all_res_struct *delete_all_rsp = (mmi_um_delete_all_res_struct*)msg_delete_all_rsp;
switch (delete_all_rsp->msg_type)
{
case UM_MSG_TYPE_MMS:
{
mmi_um_delete_all_mms_messages_rsp((U16)delete_all_rsp->result);
break;
}
case UM_MSG_TYPE_WAP_PUSH:
{
mmi_um_brw_delete_all_push_messages_rsp((U16)delete_all_rsp->result);
break;
}
}
}
/*****************************************************************************
* FUNCTION
* mmi_um_brw_mms_ready_ind
* DESCRIPTION
* Function to send an indication to UM that browser is ready.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_um_brw_mms_ready_ind(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE Message;
mmi_um_ready_ind_struct *push_um_ready_ind;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
push_um_ready_ind = (mmi_um_ready_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_ready_ind_struct));
push_um_ready_ind->result = KAL_TRUE;
push_um_ready_ind->msg_type = UM_MSG_TYPE_MMS;
/* Prepare response structure */
Message.oslSrcId = MOD_MMI;
Message.oslDestId = MOD_MMI;
Message.oslMsgId = MSG_ID_MMI_UM_READY_IND;
/* Send Response to MMI Queue */
Message.oslDataPtr = (oslParaType*) push_um_ready_ind;
Message.oslPeerBuffPtr = NULL;
OslMsgSendExtQueue(&Message);
}
/*****************************************************************************
* FUNCTION
* mmi_um_brx_get_push_messages_count_req
* DESCRIPTION
* Function to get count of unread and read push messages and send response to UM.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_um_brx_get_push_messages_count_req(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE Message;
U32 brw_total_msg_count, brw_unread_msg_count;
mmi_um_get_msg_num_rsp_struct *push_count_rsp;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_mmi_brw_delete_push_notification = MMI_FALSE;
/* update the copy of local pointers */
mmi_brw_create_push_msg_list();
mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);
push_count_rsp = (mmi_um_get_msg_num_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_msg_num_rsp_struct));
push_count_rsp->result = KAL_TRUE;
push_count_rsp->msg_type = UM_MSG_TYPE_WAP_PUSH;
push_count_rsp->inbox_unread_msg_number = brw_unread_msg_count;
push_count_rsp->inbox_read_msg_number = brw_total_msg_count - brw_unread_msg_count;
push_count_rsp->unsent_msg_number = 0;
push_count_rsp->sent_msg_number = 0;
push_count_rsp->draft_msg_number = 0;
/* Prepare response structure */
Message.oslSrcId = MOD_WAP /* MOD_MMI */;
Message.oslDestId = MOD_MMI;
Message.oslMsgId = MSG_ID_MMI_UM_GET_MSG_NUM_RSP;
/* Send Response to MMI Queue */
Message.oslDataPtr = (oslParaType*) push_count_rsp;
Message.oslPeerBuffPtr = NULL;
OslMsgSendExtQueue(&Message);
}
/*****************************************************************************
* FUNCTION
* mmi_um_brw_get_push_messages_list_req
* DESCRIPTION
* Function to get push message list information and send response to UM.
* PARAMETERS
* msg_list_req [?]
* start_entry(?) [IN] - indicates the index of node in the jataayu list from which the information is to be sent
* RETURNS
* void
*****************************************************************************/
void mmi_um_brw_get_push_messages_list_req(void *msg_list_req)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE Message;
U32 msg_counter = 0;
U32 start_entry = 0;
U32 brw_total_msg_count = 0;
U32 brw_unread_msg_count = 0;
mmi_um_get_list_rsp_struct *push_list_rsp = NULL;
mmi_um_get_list_req_struct *um_msg_list_req = NULL;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_mmi_brw_delete_push_notification = MMI_FALSE;
um_msg_list_req = (mmi_um_get_list_req_struct*) msg_list_req;
start_entry = um_msg_list_req->start_entry;
/* Buffer should free while entering the inbox screen */
mmi_brw_push_free_service_value_struct(&g_current_service_message);
mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);
push_list_rsp = (mmi_um_get_list_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_list_rsp_struct));
push_list_rsp->result = KAL_TRUE;
push_list_rsp->msg_type = UM_MSG_TYPE_WAP_PUSH;
if (UM_MSG_BOX_TYPE_INBOX == um_msg_list_req->msg_box_type)
{
push_list_rsp->msg_box_type = UM_MSG_BOX_TYPE_INBOX;
push_list_rsp->start_entry = start_entry;
if ((brw_total_msg_count - start_entry) <= MMI_UM_MAX_GET_LIST_MSG_NUMBER)
{
push_list_rsp->msg_number = brw_total_msg_count - start_entry;
}
else
{
push_list_rsp->msg_number = MMI_UM_MAX_GET_LIST_MSG_NUMBER;
push_list_rsp->more = KAL_TRUE;
}
for (msg_counter = start_entry; msg_counter < (push_list_rsp->msg_number + start_entry); msg_counter++)
{
push_list_rsp->list_info[msg_counter].msg_index = msg_counter;
push_list_rsp->list_info[msg_counter].timestamp =
mmi_um_brw_get_push_time_stamp(g_brw_service_msg_list_p[msg_counter]);
}
}
else /* UM_MSG_BOX_TYPE_INBOX != um_msg_list_req->msg_box_type */
{
/* As push message can not be a part of outbox, sent or draft folder */
push_list_rsp->msg_box_type = um_msg_list_req->msg_box_type;
push_list_rsp->start_entry = 0;
push_list_rsp->msg_number = 0;
}
/* Prepare response structure */
Message.oslSrcId = MOD_WAP /* MOD_MMI */;
Message.oslDestId = MOD_MMI;
Message.oslMsgId = MSG_ID_MMI_UM_GET_LIST_RSP;
/* Send Response to MMI Queue */
Message.oslDataPtr = (oslParaType*) push_list_rsp;
Message.oslPeerBuffPtr = NULL;
OslMsgSendExtQueue(&Message);
}
/*****************************************************************************
* FUNCTION
* mmi_um_brw_get_push_messages_info_req
* DESCRIPTION
* Function to get push message list information and send response to UM.
* PARAMETERS
* start_entry [IN] - indicates the index of node in the jataayu list from which the information is to be sent
* total_msgs [IN] - indicated that for how many messages information is to retrived
* RETURNS
* void
*****************************************************************************/
void mmi_um_brw_get_push_messages_info_req(U32 start_entry, U32 total_msgs)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE Message;
U32 msg_counter, rcvd_message_len = 0;
struct tm expiry_timestamp;
time_t current_secs_since_1970 = 0, expiry_secs_since_1970 = 0;
mmi_um_get_msg_info_rsp_struct *push_info_rsp;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
push_info_rsp = (mmi_um_get_msg_info_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_msg_info_rsp_struct));
push_info_rsp->result = KAL_TRUE;
push_info_rsp->msg_type = UM_MSG_TYPE_WAP_PUSH;
push_info_rsp->msg_box_type = UM_MSG_BOX_TYPE_INBOX;
push_info_rsp->start_entry = start_entry;
push_info_rsp->msg_number = total_msgs;
for (msg_counter = start_entry; msg_counter < total_msgs + start_entry; msg_counter++)
{
push_info_rsp->msg_info[msg_counter - start_entry].msg_index = msg_counter;
push_info_rsp->msg_info[msg_counter - start_entry].timestamp =
mmi_um_brw_get_push_time_stamp(g_brw_service_msg_list_p[msg_counter]);
push_info_rsp->msg_info[msg_counter - start_entry].address_type = UM_ADDR_TYPE_PHONE_NUMBER; /* to be ignored */
push_info_rsp->msg_info[msg_counter - start_entry].address_length = 0;
memset(push_info_rsp->msg_info[msg_counter - start_entry].address, 0, MMI_UM_MAX_ADDR_LEN);
if (g_brw_service_msg_list_p[msg_counter]->service_flag == SERVICE_INDICATION)
{
rcvd_message_len = pfnUnicodeStrlen((S8*) g_brw_service_msg_list_p[msg_counter]->pmMessage);
if (0 != rcvd_message_len)
{
if ((rcvd_message_len * ENCODING_LENGTH) < MMI_UM_MAX_SUBJECT_LEN - ENCODING_LENGTH)
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = rcvd_message_len;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmMessage,
rcvd_message_len);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, "\0\0");
}
else
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = MMI_UM_MAX_SUBJECT_LEN;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmMessage,
(MMI_UM_MAX_SUBJECT_LEN / ENCODING_LENGTH) - 4);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, ".\0.\0.\0\0\0");
}
}
else /* if message body for SI is not available then href should dispaly as subject */
{
rcvd_message_len = pfnUnicodeStrlen((S8*) g_brw_service_msg_list_p[msg_counter]->pmHref);
if ((rcvd_message_len * ENCODING_LENGTH) < MMI_UM_MAX_SUBJECT_LEN - ENCODING_LENGTH)
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = rcvd_message_len;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmHref,
rcvd_message_len);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, "\0\0");
}
else
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = MMI_UM_MAX_SUBJECT_LEN;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmHref,
(MMI_UM_MAX_SUBJECT_LEN / ENCODING_LENGTH) - 4);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, ".\0.\0.\0\0\0");
}
}
}
else /* SERVICE_LOADING */
{
rcvd_message_len = pfnUnicodeStrlen((S8*) g_brw_service_msg_list_p[msg_counter]->pmHref);
if ((rcvd_message_len * ENCODING_LENGTH) < MMI_UM_MAX_SUBJECT_LEN - ENCODING_LENGTH)
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = rcvd_message_len;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmHref,
rcvd_message_len);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, "\0\0");
}
else
{
push_info_rsp->msg_info[msg_counter - start_entry].subject_length = MMI_UM_MAX_SUBJECT_LEN;
pfnUnicodeStrncpy(
(S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject,
(S8*) g_brw_service_msg_list_p[msg_counter]->pmHref,
(MMI_UM_MAX_SUBJECT_LEN / ENCODING_LENGTH) - 4);
pfnUnicodeStrcat((S8*) push_info_rsp->msg_info[msg_counter - start_entry].subject, ".\0.\0.\0\0\0");
}
}
if (g_brw_service_msg_list_p[msg_counter]->service_flag == SERVICE_INDICATION)
{
if (g_brw_service_msg_list_p[msg_counter]->pSIExpires != NULL)
{
expiry_timestamp.tm_mon = g_brw_service_msg_list_p[msg_counter]->pSIExpires->month - 1; /* month scale to 0 to 11 */
expiry_timestamp.tm_year = g_brw_service_msg_list_p[msg_counter]->pSIExpires->year - 1900; /* offset since 1900 */
expiry_timestamp.tm_mday = g_brw_service_msg_list_p[msg_counter]->pSIExpires->day;
expiry_timestamp.tm_hour = g_brw_service_msg_list_p[msg_counter]->pSIExpires->hour;
expiry_timestamp.tm_min = g_brw_service_msg_list_p[msg_counter]->pSIExpires->minute;
expiry_timestamp.tm_sec = g_brw_service_msg_list_p[msg_counter]->pSIExpires->seconds;
/* Get difference of seconds of expiry time from 1970 (as per UTC standard) */
expiry_secs_since_1970 = (time_t) mktime(&expiry_timestamp);
/* Get difference of seconds of current time from 1970 (as per UTC standard) */
current_secs_since_1970 = get_current_utc_time();
}
if (g_brw_service_msg_list_p[msg_counter]->bIsRead == 0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -