JMMSPushHandling.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:114k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2002
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * jmms_push_handling.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file conains the store APIs for interacting with Jatayu Store module
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /*****************************************************************************
- * Include
- *****************************************************************************/
- #include "MMI_features.h"
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "HistoryGprot.h"
- #include "GlobalDefs.h"
- #include "SettingProfile.h"
- #include "DebugInitDef.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "wgui_inputs.h"
- #include "wgui_datetime.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_popup.h"
- #include "ProfileGprots.h" /* playRequestedTone() */
- #include "MainMenuDef.h"
- #include "IdleAppDef.h"
- #include "QuickAccessMenuItemProt.h"
- #include "TimerEvents.h"
- #include <ddl.h>
- #include <jcal.h>
- #include <jcalnet.h>
- #include "jdi_wspdatatype.h"
- #include "jdi_transport.h"
- #include <miscutils.h>
- #include <jdi_communicator.h>
- #include <MessagingDatatypes.h>
- #include <MessagingAPI.h>
- #include "JsrTypes.h"
- #include "JMMSView.h"
- #include "DateTimeDef.h"
- #include "DateTimeType.h"
- #include "DateTimeGprot.h"
- #include "MessagesResourceData.h"
- #include "DebugInitDef.h" /* Debug Info */
- #include "JMMSConfig.h"
- #include "JMMSMessageSettings.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSDrafts.h"
- #include "JMMSExdcl.h"
- /* /#include "JMMSGdcl.h" */
- #include "JMMSCompose.h"
- #include "JMMSGprot.h"
- #include "JMMSInbox.h"
- #include "JMMSJSRHandler.h"
- #include "JMMSMainMMS.h"
- #include "JMMSMessageSettingsUtils.h"
- #include "JMMSOutbox.h"
- #include "JMMSProtocols.h"
- #include "JMMSPushHandling.h"
- #include "JMMSResEnum.h"
- #include "JMMSSent.h"
- #include "JMMSStoreHandling.h"
- #include "JMMSStructs.h"
- #include "JMMSTemplates.h"
- #include "JMMSUseDetails.h"
- #include "JMMSView.h"
- #include "JMMSWriteMMS.h"
- #include "wapadp.h"
- #include "JPushInboxCommonUI.h"
- #include "JMMSPlutoMMIInterface.h"
- #ifdef __USB_IN_NORMAL_MODE__
- #include "USBDeviceGprot.h"
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PROMPT_TEXT__
- #include "KeyBrd.h"
- #endif
- #ifdef __MMI_UNIFIED_MESSAGE__
- #include "UnifiedMessageDef.h"
- #include "UnifiedMessageProt.h"
- #include "JMMSUMHandling.h"
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * Define
- *****************************************************************************/
- //Define for the read report prepend string
- #define STR_JMMS_READ_REPORT_PREPEND_STRING "Read:"
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- extern void EntryScrAfterPessingRSK(void);
- extern em_wap_user_agent_brand_enum wap_get_user_agent_brand(void);
- U16 DeleteScreenFromToNnodes(U16 ScrId, U16 num_nodes);
- U8 DeleteFromScrUptoScr(U16 beyondScrnid, U16 tillScrnid);
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_update_roaming_status
- * DESCRIPTION
- *
- * PARAMETERS
- * isRoaming [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_update_roaming_status(unsigned long isRoaming)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_jmms_context != NULL)
- {
- g_jmms_context->curr_roaming_state = (U32) isRoaming;
- }
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- #define REFRESH_INBOX_TIMEOUT 1000
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_go_back_refresh_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_go_back_refresh_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(POPUP_TIMER);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_exit_refresh_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_exit_refresh_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(POPUP_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_refresh_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_refresh_inbox_no_screen_update(void)
- {
- if ((IsScreenPresent(SCR_ID_JMMS_INBOX)) || (GetActiveScreenId() == SCR_ID_JMMS_INBOX))
- {
- g_jmms_context->store_context->update_nmsgs_in_current_folder=1;
- g_jmms_context->nCurr_scr_hilited_index=0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_refresh_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_refresh_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_refresh_inbox"));
- mmi_jmms_refresh_inbox_no_screen_update();
- if(GetActiveScreenId() != SCR_ID_JMMS_INBOX)
- return;
- StartTimer(POPUP_TIMER, REFRESH_INBOX_TIMEOUT, mmi_jmms_go_back_refresh_inbox);
- EntryNewScreen(POPUP_SCREENID, mmi_jmms_exit_refresh_inbox, NULL, NULL);
- ShowCategory66Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_ID_JMMS_LOADING_MMS),
- IMG_GLOBAL_PROGRESS,
- NULL);
- ClearAllKeyHandler();
- }
- #endif
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_new_mms_notification
- * DESCRIPTION
- *
- * PARAMETERS
- * view_content [?] [?] [?]
- * hMsgHandle [IN]
- * pNotifyIndHdrs [?] [?] [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_new_mms_notification(
- CONTENT_DATA *view_content,
- MSG_HANDLE hMsgHandle,
- MESSAGE_NOTIFICATION *pNotifyIndHdrs)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifndef __MMI_MMS_OMA_CONF_273__
- JC_UINT32 temp;
- #endif
- U32 roaming_status;
- U8 retrieval_mode;
- JC_RETCODE eRet = JC_OK;
- JC_UINT32 msg_index;
- /* JC_UINT32 msgid = 0; */
- MESSAGE_HEADERS *pMsgHdrs = NULL;
- JC_UINT32 mms_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* /check the retrival mnode */
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_new_mms_notification"));
- roaming_status = g_jmms_context->curr_roaming_state;
- if (roaming_status == 1)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Roaming status is 1."));
- if (E_ROAMING_RETRIEVAL_AS_HOME == (U16) mmi_jmms_retrieval_settings_roaming_retrieval_mode())
- {
- retrieval_mode = mmi_jmms_retrieval_settings_home_network_retrieval_mode();
- }
- else
- {
- retrieval_mode = mmi_jmms_retrieval_settings_roaming_retrieval_mode();
- }
- }
- else
- {
- retrieval_mode = mmi_jmms_retrieval_settings_home_network_retrieval_mode();
- }
- if (retrieval_mode == E_ROAMING_RETRIEVAL_RESTRICTED) /* /E_ROAMING_RETRIEVAL_IMMEDAITE and E_HOME_NOETWORK_RETRIEVAL_IMMEDAITE */
- /* have same values */
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms Retrival Mode: %s", "RETRIEVAL_RESTRICTED"));
- eRet = mmi_jmms_notification_reponse(pNotifyIndHdrs, E_MSG_REJECTED);
- return;
- }
- #ifndef __MMI_MMS_OMA_CONF_273__
- /* /check the filters */
- temp = 1024 * (JC_UINT32) mmi_jmms_retrieval_settings_msg_size_filter(); /* in bytes */
- #endif /* __MMI_MMS_OMA_CONF_273__ */
- if ((pNotifyIndHdrs->eMsgClass == E_MSG_ADVERTISEMENT_CLASS &&
- E_REJECT == mmi_jmms_retrieval_settings_advertisment_filter()) || ((pNotifyIndHdrs->pFrom == NULL) &&
- E_REJECT ==
- mmi_jmms_retrieval_settings_anonymous_filter
- ())
- #ifndef __MMI_MMS_OMA_CONF_273__
- || (pNotifyIndHdrs->uiMessageSize > temp)
- #endif
- )
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms send the notification response with Reject Status"));
- /* /send the notfication response with reject status */
- eRet = mmi_jmms_notification_reponse(pNotifyIndHdrs, E_MSG_REJECTED);
- return;
- }
- #ifdef __MMI_MMS_OMA_CONF_273__
- if(pNotifyIndHdrs->uiMessageSize > MAX_MMS_MSG_SIZE)
- {
- retrieval_mode = E_ROAMING_RETRIEVAL_DEFFERED;
- }
- #endif
- #ifdef __USB_IN_NORMAL_MODE__
- if (mmi_jmms_check_usb_mode() == 1)
- {
- retrieval_mode = E_ROAMING_RETRIEVAL_DEFFERED;
- }
- #endif /* __USB_IN_NORMAL_MODE__ */
- if (retrieval_mode == E_ROAMING_RETRIEVAL_IMMEDAITE)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms retrival mode: %s", "RETRIEVAL_IMMEDAITE"));
- eRet = mmi_jmms_jdi_get_msg_headers(hMsgHandle, &pMsgHdrs);
- if (JC_OK == eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms saving the notification into InBox."));
- /* save notification in inbox. */
- eRet = mmi_jmms_save_message_buffer_in_Store("Inbox", &(mms_index), pMsgHdrs, view_content, NULL);
- if(eRet == JC_OK)
- mmi_jmms_set_msg_as_unread(mms_index-1);
- if (eRet != JC_OK)
- {
- mms_index = 0; /* it means notification didn't save successfully */
- if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_MEMORY_ERROR_NEW_MMS_NOTIF_SAVING,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_NEW_MMS_NOTIF_SAVING,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- return;
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_jmms_refresh_ind();
- #else
- mmi_jmms_refresh_inbox();
- #endif
- }
- /* PMT VIKAS START 20060401 */
- //mmi_jmms_update_status_icon_indicator();
- /* PMT VIKAS END 20060401 */
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms fail to get the MMS Header %d", eRet));
- }
- mmi_jmms_download_mms(pNotifyIndHdrs->pContentLocation, E_TYPE_IMMEDIATE_RETRIEVAL_FETCH, mms_index, 1);
- }
- else if (retrieval_mode == E_ROAMING_RETRIEVAL_DEFFERED)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms Retrival Mode: %s", "RETRIEVAL_DEFFERED"));
- eRet = mmi_jmms_notification_reponse(pNotifyIndHdrs, E_MSG_DEFERRED);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms saving the notification into InBox return: %d", eRet));
- if (eRet == JC_OK)
- {
- eRet = mmi_jmms_jdi_get_msg_headers(hMsgHandle, &pMsgHdrs);
- if (JC_OK == eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms saving the notification into InBox"));
- /* save notification in inbox. */
- eRet = mmi_jmms_save_message_buffer_in_Store("Inbox", &msg_index, pMsgHdrs, view_content, NULL);
- if(eRet == JC_OK)
- mmi_jmms_set_msg_as_unread(msg_index-1);
- /* PMT VIKAS START 20060401 */
- mmi_jmms_update_status_icon_indicator();
- /* PMT VIKAS END 20060401 */
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s:%d", "save result", eRet));
- if (eRet == JC_OK)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) msg_index,
- (U8) E_MSG_TYPE_NOTIFICATION,
- (S8*) pNotifyIndHdrs->pContentLocation);
- if (eRet == JC_OK)
- {
- /* Display pop up according to idle screen or not. */
- mmi_jmms_show_new_mms_pop_up();
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_refresh_inbox_no_screen_update();
- #endif
- }
- else
- {
- if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_MEMORY_ERROR_NEW_MMS_NOTIF_SAVING,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_NEW_MMS_NOTIF_SAVING,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_NEW_MMS_NOTIF_SAVING,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- }
- }
- }
- ///msg_index is used for immediate retrieval fetch to store the index of mms to be
- //updated after downlaoding of mms
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_download_mms
- * DESCRIPTION
- *
- * PARAMETERS
- * content_location [?] [?] [?]
- * comm_state [IN]
- * msg_index [IN]
- * retry_counter [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_download_mms(JC_INT8 *content_location, U16 comm_state, JC_UINT32 msg_index, U8 retry_counter)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- COMM_FETCH_URL fetchUrlInfo = {0, };
- JC_UINT32 uiReferenceID = 1;
- S8 *temp_url = NULL;
- S32 len = 0;
- S8 *mms_content_location = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_download_mms"));
- fetchUrlInfo.eContentMode = E_COMM_BUFFER;
- len = (strlen((S8*) content_location) + 1);
- /* adding for retry mechanism */
- mms_content_location = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (mms_content_location == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto END;
- }
- /* /commenitng for retry mechnaism */
- temp_url = (S8*) jdd_MemAlloc(sizeof(S8), len * ENCODING_LENGTH);
- if (temp_url == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto END;
- }
- strcpy((char*)mms_content_location, (const char*)content_location);
- AnsiiToUnicodeString((S8*) temp_url, (S8*) content_location);
- fetchUrlInfo.pszURL = (JC_CHAR*) temp_url;
- fetchUrlInfo.pszContentType = NULL;
- fetchUrlInfo.uUserDataMode.pucPostData = NULL;
- fetchUrlInfo.bIsFile = E_FALSE;
- fetchUrlInfo.uiPostLen = 0;
- fetchUrlInfo.pHeadersInfo = NULL;
- fetchUrlInfo.eCommFetchType = E_COMM_FETCH_GET;
- if (comm_state == E_TYPE_DEFFERED_RETRIEVAL_FETCH)
- {
- /*
- * For deffered Retrieval need to use the g_jmms_context->uiReferenceID variable beacuse downloading screen
- * is there and downloading can be cancelled. Also don't use this variable for Immediate Retrieval etc.
- * because during Sending/Defered Downlaod there can be immediate retrieval so this varaiable can be overwritten.
- *
- * This variable is used during Sending/Deffered Downloading beacause Sending/Deffered Downlaoding can be
- * cancelled by user and so we require this value in jdi_CommunicationStopReq().
- * Also there is no harm on using the same varaible for sending and deffered retrieval because sending and
- * deffered retrieval cann't be both together.
- */
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms comm State: %s", "E_TYPE_DEFFERED_RETRIEVAL_FETCH"));
- g_jmms_context->uiReferenceID = 0;
- eRet = jdi_CommunicationFetchURL(g_jmms_context->hCommHandle, &fetchUrlInfo, &g_jmms_context->uiReferenceID);
- if (eRet == JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "JMMS Comm Fetch Download", g_jmms_context->uiReferenceID));
- eRet = mmi_jmms_add_comm_node(
- g_jmms_context,
- g_jmms_context->uiReferenceID,
- comm_state,
- NULL,
- msg_index,
- retry_counter,
- mms_content_location);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to add comm node", eRet));
- jdi_CommunicationFreeReference(g_jmms_context->hCommHandle, g_jmms_context->uiReferenceID);
- g_jmms_context->uiReferenceID = 0;
- eRet = JC_ERR_MEMORY_ALLOCATION;
- }
- }
- }
- else
- {
- eRet = jdi_CommunicationFetchURL(g_jmms_context->hCommHandle, &fetchUrlInfo, &uiReferenceID);
- if (eRet == JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "JMMS Comm Fetch Download", uiReferenceID));
- eRet = mmi_jmms_add_comm_node(
- g_jmms_context,
- uiReferenceID,
- comm_state,
- NULL,
- msg_index,
- retry_counter,
- mms_content_location);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to add comm node", eRet));
- jdi_CommunicationFreeReference(g_jmms_context->hCommHandle, uiReferenceID);
- eRet = JC_ERR_MEMORY_ALLOCATION;
- }
- }
- }
- END:
- if (temp_url != NULL)
- {
- jdd_MemFree(temp_url);
- }
- if (eRet != JC_OK)
- {
- if (mms_content_location != NULL)
- {
- jdd_MemFree(mms_content_location);
- }
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_notification_reponse
- * DESCRIPTION
- *
- * PARAMETERS
- * pNotification [?] [?] [?]
- * eMessageStatus [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_notification_reponse(MESSAGE_NOTIFICATION *pNotification, EMessageStatus eMessageStatus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- NOTIFICATION_RESPONSE *pNotRespHdr = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- MSG_HANDLE mms_signal_handle = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_notification_reponse"));
- if (pNotification == NULL || pNotification->pTransactionID == NULL || pNotification->pVersion == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_msg_init(&mms_signal_handle, NULL);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms msg Initialization Failed", eRet));
- goto ERROR_HANDLE;
- }
- pMsgHeaders = (MESSAGE_HEADERS*) jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
- if (pMsgHeaders == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_set_msg_headers(mms_signal_handle, pMsgHeaders);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to set the message header", eRet));
- goto ERROR_HANDLE;
- }
- pNotRespHdr = (NOTIFICATION_RESPONSE*) jdd_MemAlloc(sizeof(NOTIFICATION_RESPONSE), 1);
- if (pNotRespHdr == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pNotRespHdr->pVersion = (JC_INT8*) jdi_UtilsStrdup(pNotification->pVersion);
- pNotRespHdr->pTransactionID = jdi_UtilsStrdup(pNotification->pTransactionID);
- pNotRespHdr->eMessageStatus = eMessageStatus;
- pNotRespHdr->bDeliveryReport = (JC_BOOLEAN) mmi_jmms_retrieval_settings_delivery_report();
- pMsgHeaders->eMsgType = E_MSG_TYPE_NOTIFICATION_RESPONSE;
- pMsgHeaders->pHeaders = pNotRespHdr;
- eRet = mmi_jmms_jdi_set_msg_headers(mms_signal_handle, pMsgHeaders);
- if (JC_OK != eRet)
- {
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_send_mms(mms_signal_handle, E_TYPE_NOTIFICATION_RESPONSE, E_TRUE, 1, E_FALSE);
- ERROR_HANDLE:
- if (mms_signal_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * jmms_mmi_notification_response_for_immediate_retrieval
- * DESCRIPTION
- *
- * PARAMETERS
- * ViewContent [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE jmms_mmi_notification_response_for_immediate_retrieval(CONTENT_DATA ViewContent)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- NOTIFICATION_RESPONSE *pNotRespHdr = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- MESSAGE_RETRIEVAL *pNotifyIndHdrs = NULL;
- MSG_HANDLE mms_signal_handle = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms_mmi_notification_response_for_immediate_retrieval"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&mms_signal_handle, &ViewContent, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(mms_signal_handle);
- }
- /* Async changes end */
- if (JC_OK != eRet && mms_signal_handle != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms error in parsing", eRet));
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- return eRet;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(mms_signal_handle, &pMsgHeaders);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to get the message header", eRet));
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- return eRet;
- }
- if (pMsgHeaders->eMsgType != E_MSG_TYPE_RECEIVE)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- return E_UNKNOWN_MSG;
- }
- pNotifyIndHdrs = (MESSAGE_RETRIEVAL*) pMsgHeaders->pHeaders;
- if (pNotifyIndHdrs == NULL || pNotifyIndHdrs->pTransactionID == NULL || pNotifyIndHdrs->pVersion == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto ERROR_HANDLE;
- }
- pNotRespHdr = (NOTIFICATION_RESPONSE*) jdd_MemAlloc(sizeof(NOTIFICATION_RESPONSE), 1);
- if (pNotRespHdr == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pNotRespHdr->pVersion = jdi_UtilsStrdup(pNotifyIndHdrs->pVersion);
- pNotRespHdr->pTransactionID = jdi_UtilsStrdup(pNotifyIndHdrs->pTransactionID);
- pNotRespHdr->eMessageStatus = E_MSG_RETRIEVED;
- pNotRespHdr->bDeliveryReport = (JC_BOOLEAN) mmi_jmms_retrieval_settings_delivery_report();
- if (NULL != mms_signal_handle)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- }
- eRet = mmi_jmms_jdi_msg_init(&mms_signal_handle, NULL);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms msg Initialization Failed", eRet));
- mms_signal_handle = NULL;
- goto ERROR_HANDLE;
- }
- pMsgHeaders = (MESSAGE_HEADERS*) jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
- if (pMsgHeaders == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pMsgHeaders->eMsgType = E_MSG_TYPE_NOTIFICATION_RESPONSE;
- pMsgHeaders->pHeaders = pNotRespHdr;
- eRet = mmi_jmms_jdi_set_msg_headers(mms_signal_handle, pMsgHeaders);
- if (JC_OK != eRet)
- {
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_send_mms(mms_signal_handle, E_TYPE_NOTIFICATION_RESPONSE, E_TRUE, 1, E_FALSE);
- ERROR_HANDLE:
- if (mms_signal_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d",
- "jmms mms_mmi_notification_response_for_immediate_retrieval return value: ", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_show_mms_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_show_mms_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- S8 temp[14];
- U8 dttemp[40];
- MYTIME time1, time;
- FLOAT timezone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_entry_show_mms_screen"));
- timezone = mmi_dt_get_tz();
- EntryNewScreen(SCR_ID_JMMS_NEW_MMS, NULL, mmi_jmms_entry_show_mms_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NEW_MMS);
- pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pFrom == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pFrom);
- }
- /* /TO */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pTo == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pTo);
- }
- /* /CC */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_CC));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pCc == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pCc);
- }
- /* /Subject */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pSubject == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pSubject);
- }
- /* /Date */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- mmi_dt_utc_sec_2_mytime((U32) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->uiDate, &time1, MMI_TRUE);
- mmi_dt_utc_to_rtc(timezone, time1, time);
- /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
- /* Date */
- memset(dttemp, 0x00, 40);
- date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- memset(temp, 0x00, 6);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- /* Time */
- memset(dttemp, 0x00, 40);
- time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- /* END of Changes - RAJ KUMAR GUPTA*/
- ShowCategory78Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_ID_JMMS_PLAY,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- NULL,
- (U8*) subMenuData,
- pfnUnicodeStrlen((S8*) subMenuData),
- gui_buffer);
- SetRightSoftkeyFunction(mmi_jmms_back_msg_view_entry, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_back_msg_view_entry, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_jmms_play_mms, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_play_mms, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_play_mms, KEY_WAP, KEY_EVENT_DOWN);
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_end_mms_play, KEY_END, KEY_EVENT_DOWN);
- DeleteScreenIfPresent(SCR_ID_JMMS_READ_REPORT_QUERY);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_end_mms_play
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_end_mms_play(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_end_mms_play"));
- mmi_jmms_deinit_mms_context(g_jmms_context);
- mmi_jmms_free_delivery_report_header();
- mmi_jmms_free_report_report_header();
- DisplayIdleScreen();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_play_mms
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_play_mms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CONTENT_DATA Content = {0, };
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_play_mms"));
- mmi_jmms_deinit_mms_context(g_jmms_context);
- Content.bIsStream = E_TRUE;
- eRet = mmi_jmms_get_message("Inbox", &Content, g_jmms_context->mms_index);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to get the message from InBox.", eRet));
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_deinit_view();
- #endif
- eRet = mmi_jmms_pre_entry_mms_view(&Content);
- if (g_jmms_context->last_scr_id != IDLE_SCREEN_ID && g_jmms_context->last_scr_id == SCR_ID_JMMS_INBOX_OPTIONS)
- {
- /* it means download from Inbox */
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- #else
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- #endif
- }
- DeleteScreenIfPresent(SCR_ID_JMMS_READ_REPORT_QUERY);
- DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
- DeleteScreenIfPresent(SCR_ID_JMMS_POP_SCREEN);
- DeleteScreenIfPresent(SCR_ID_JMMS_INBOX_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_JMMS_NEW_MMS);
- DeleteScreenIfPresent(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
- if (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- return;
- }
- END:
- if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
- {
- eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_back_msg_view_entry
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_back_msg_view_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_deinit_mms_context(g_jmms_context);
- mmi_jmms_free_delivery_report_header();
- mmi_jmms_free_report_report_header();
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DisplayIdleScreen();
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- GoBackToHistory(SCR_ID_UM_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* PMTSW00006306 Fix : Lines commented as it will clear old history and issue in highlight handler */
- // HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox_screen);
- GoBackToHistory(SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_need_mms_ind
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 mmi_jmms_need_mms_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 need_ind = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if !defined(__MMI_UNIFIED_MESSAGE__) && defined (__USB_IN_NORMAL_MODE__)
- if (mmi_usb_is_in_mass_storage_mode() == KAL_FALSE)
- #endif
- {
- if (g_jmms_context != NULL && g_jmms_context->pending_mms_info_list != NULL)
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- #endif
- {
- need_ind = 1;
- }
- }
- return need_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_new_mms_ind
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_new_mms_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 strid = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_entry_new_mms_ind"));
- if (g_jmms_context == NULL)
- {
- g_jmms_context = (jmms_context_struct*) jdd_MemAlloc(sizeof(jmms_context_struct), 1);
- if (g_jmms_context == NULL)
- {
- DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
- return;
- }
- }
- if (g_jmms_context->pending_mms_info_list == NULL)
- {
- return;
- }
- EntryNewScreen(SCR_ID_JMMS_NEW_MMS_IND, NULL, NULL, NULL);
- /* sandeep start in error situations like when fail to save mms notification ring tone should not play
- // amit start
- PlayMessageArrivalTone();
- // amit end tone play on idle screen
- */
- GetCurrEndKeyDownHandler();
- if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_DELIVERY_REPORT
- || g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_READ_REPORT_RESPONSE
- || g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_RECEIVE)
- {
- strid = STR_ID_JMMS_READ_NEW_MMS;
- }
- else if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_NOTIFICATION)
- {
- strid = STR_ID_JMMS_DOWNLOAD_NEW_MMS;
- }
- else if (g_jmms_context->pending_mms_info_list->type != E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- return;
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->pending_mms_info_list->type != E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- mmi_um_jmms_new_mms_message_ind(g_jmms_context->pending_mms_info_list->Index);
- }
- else
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- { /* vikas added */
- if (g_keylock_context.gKeyPadLockFlag == 0)
- {
- if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- ShowCategory2Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- g_jmms_context->pending_mms_info_list->Index,
- NULL);
- SetRightSoftkeyFunction(mmi_jmms_delete_mms_pop_up_node, KEY_EVENT_UP);
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_free_mms_pop_ups_list, KEY_END, KEY_EVENT_DOWN); /* /delete the link list */
- }
- else
- {
- ShowCategory154Screen(
- 0,
- 0,
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- (PU8) GetString(strid),
- NULL,
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- SetRightSoftkeyFunction(mmi_jmms_delete_mms_pop_up_node, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_jmms_handle_mms_pop_up, KEY_EVENT_UP);
- if (isInCall() == FALSE)
- {
- SetKeyHandler(mmi_jmms_free_mms_pop_ups_list, KEY_END, KEY_EVENT_DOWN); /* /delete the link list */
- //sandeep
- //PlayMessageArrivalTone();
- //sandeep
- }
- }
- }
- else /* keypad is locked */
- {
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-26
- if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- ShowCategory2Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- #ifdef __MMI_TOUCH_SCREEN__
- SCREEN_LOCKED_TEXT,
- #else
- KEYPAD_LOCKED_RSK_TEXT,
- #endif
- 0,
- g_jmms_context->pending_mms_info_list->Index,
- NULL);
- }
- else
- {
- ShowCategory154Screen(
- 0,
- 0,
- 0,
- 0,
- #ifdef __MMI_TOUCH_SCREEN__
- SCREEN_LOCKED_TEXT,
- #else
- KEYPAD_LOCKED_RSK_TEXT,
- #endif
- 0,
- (PU8) GetString(strid),
- NULL,
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- if (isInCall() == FALSE)
- {
- //sandeep
- //PlayMessageArrivalTone();
- //sandeep
- }
- }
- #else /* __MMI_KEYPAD_LOCK_PATTERN_1__ || __MMI_KEYPAD_LOCK_PATTERN_3__ ||__MMI_KEYPAD_LOCK_PATTERN_4__ */ //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- if (g_jmms_context->pending_mms_info_list->type == E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- ShowCategory2Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- #ifdef __MMI_TOUCH_SCREEN__
- SCREEN_LOCKED_TEXT.
- #else
- KEYPAD_LOCKED_RSK_TEXT,
- #endif
- ,
- 0,
- 0,
- 0,
- g_jmms_context->pending_mms_info_list->Index,
- NULL);
- }
- else
- {
- ShowCategory154Screen(
- 0,
- 0,
- #ifdef __MMI_TOUCH_SCREEN__
- SCREEN_LOCKED_TEXT,
- #else
- KEYPAD_LOCKED_RSK_TEXT,
- #endif
- ,
- 0,
- 0,
- 0,
- (PU8) GetString(strid),
- NULL,
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- if (isInCall() == FALSE)
- {
- //sandeep
- PlayMessageArrivalTone();
- //sandeep
- }
- }
- #endif /* __MMI_KEYPAD_LOCK_PATTERN_1__ || __MMI_KEYPAD_LOCK_PATTERN_3__ || __MMI_KEYPAD_LOCK_PATTERN_4__ */ //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- #if defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__)
- SetGroupKeyHandler(
- EntryScrKeyPadLockOnPessingAnyKey,
- (PU16) PresentAllKeys,
- (U8) TOTAL_KEYS,
- (U16) KEY_EVENT_DOWN);
- #endif /* defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__) */
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- #ifdef __MMI_KEYPAD_LOCK_PROMPT_TEXT__
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- SetRightSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
- SetLeftSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
- #endif
- #else
- ClearKeyHandler(KEY_LSK, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_LSK, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RSK, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RSK, KEY_EVENT_UP);
- #endif /* __MMI_KEYPAD_LOCK_PROMPT_TEXT__ */
- SetKeyHandler(EntryScrAfterPessingRSK, KEY_SEND, KEY_EVENT_DOWN);
- #else/* __MMI_TOUCH_SCREEN__ && !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__" on 2007-3-26
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- SetRightSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
- SetLeftSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_TOUCH_SCREEN__ && !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__" on 2007-3-26
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_idle_pen_block();
- #endif
- }
- } /* vikas added */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_delete_mms_pop_up_node
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_delete_mms_pop_up_node(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_pending_mms_info_struct *node = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_delete_mms_pop_up_node"));
- node = g_jmms_context->pending_mms_info_list;
- if (node == NULL)
- {
- GoBackToHistory(IDLE_SCREEN_ID);
- return;
- }
- if (node->type == E_MSG_TYPE_DELIVERY_REPORT)
- {
- jmms_pending_mms_delivery_reports_struct *node1 = NULL;
- if (g_jmms_context->pending_delivery_reports != NULL)
- {
- node1 = g_jmms_context->pending_delivery_reports->next;
- if (g_jmms_context->pending_delivery_reports->to_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_delivery_reports->to_p);
- }
- jdd_MemFree(g_jmms_context->pending_delivery_reports);
- g_jmms_context->pending_delivery_reports = node1;
- }
- }
- else if (node->type == E_MSG_TYPE_READ_REPORT_RESPONSE)
- {
- jmms_pending_mms_read_reports_struct *node1 = NULL;
- if (g_jmms_context->pending_read_reports != NULL)
- {
- node1 = g_jmms_context->pending_read_reports->next;
- if (g_jmms_context->pending_read_reports->from_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_read_reports->from_p);
- }
- jdd_MemFree(g_jmms_context->pending_read_reports);
- g_jmms_context->pending_read_reports = node1;
- }
- }
- g_jmms_context->pending_mms_info_list = node->next;
- if (node->mms_url != NULL)
- {
- jdd_MemFree(node->mms_url);
- }
- jdd_MemFree(node);
- node = NULL;
- GoBackToHistory(IDLE_SCREEN_ID);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_mms_pop_up
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_mms_pop_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_pending_mms_info_struct *node = NULL;
- JC_RETCODE eRet = JC_OK;
- JC_INT32 index = 0;
- CONTENT_DATA Content = {0, };
- U8 type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_mms_pop_up"));
- node = g_jmms_context->pending_mms_info_list->next;
- index = (JC_INT32) g_jmms_context->pending_mms_info_list->Index;
- type = g_jmms_context->pending_mms_info_list->type;
- ///set the msg status as open for At Delete
- ///It will reset on going to idle screen
- g_jmms_context->msg_open_status[0] = E_JMMS_INBOX;
- /* PMT HIMANSHU START 20060425 */
- g_jmms_context->msg_open_status[1] = (U32) mmi_jmms_get_message_id(MMI_JMMS_INBOX, index);
- /* PMT HIMANSHU END 20060425 */
- switch (type)
- {
- case E_MSG_TYPE_NOTIFICATION:
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms msg type: %s", "E_MSG_TYPE_NOTIFICATION"));
- if (g_jmms_context->pending_mms_info_list->mms_url == NULL)
- {
- jdd_MemFree(g_jmms_context->pending_mms_info_list);
- g_jmms_context->pending_mms_info_list = NULL;
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- eRet = mmi_jmms_download_mms(
- (JC_INT8*) g_jmms_context->pending_mms_info_list->mms_url,
- E_TYPE_DEFFERED_RETRIEVAL_FETCH,
- index,
- 1);
- if (eRet == JC_OK)
- {
- g_jmms_context->last_scr_id = IDLE_SCREEN_ID;
- g_jmms_context->progress_screen_title = STR_ID_JMMS_MMS_DOWNLOADING;
- memset(g_jmms_context->g_jmms_progress_str, 0x00, MAX_PROGRESS_SCREEN_HINT_LEN * ENCODING_LENGTH);
- mmi_jmms_entry_communication_progress_screen();
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to download the message", eRet));
- }
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- case E_MSG_TYPE_DELIVERY_REPORT:
- {
- jmms_pending_mms_delivery_reports_struct *node1 = NULL;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms msg type: %s", "E_MSG_TYPE_DELIVERY_REPORT"));
- if (g_jmms_context->pending_delivery_reports == NULL)
- {
- /* no delivery report node present */
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- g_jmms_context->last_scr_id = IDLE_SCREEN_ID;
- eRet = mmi_jmms_create_delivery_report_header_for_idle_screen(g_jmms_context->pending_delivery_reports);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- }
- else
- {
- /* /for setting read status */
- mmi_jmms_set_msg_as_read((U8) (index - 1));
- mmi_jmms_entry_show_delivery_report_screen();
- }
- /* /free the delivery report node */
- node1 = g_jmms_context->pending_delivery_reports->next;
- if (g_jmms_context->pending_delivery_reports->to_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_delivery_reports->to_p);
- }
- jdd_MemFree(g_jmms_context->pending_delivery_reports);
- g_jmms_context->pending_delivery_reports = node1;
- /* free the node for general message */
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- case E_MSG_TYPE_READ_REPORT_RESPONSE:
- {
- jmms_pending_mms_read_reports_struct *node1 = NULL;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "jmms msg type: %s", "E_MSG_TYPE_READ_REPORT_RESPONSE"));
- if (g_jmms_context->pending_read_reports == NULL)
- {
- //no report report node present
- //free the node for general message
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- g_jmms_context->last_scr_id = IDLE_SCREEN_ID;
- eRet = mmi_jmms_create_read_report_header_for_idle_screen(g_jmms_context->pending_read_reports);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- }
- else
- {
- /* /for setting read status */
- mmi_jmms_set_msg_as_read((U8) (index - 1));
- mmi_jmms_entry_show_read_report_screen();
- }
- /* /free the read report node */
- node1 = g_jmms_context->pending_read_reports->next;
- if (g_jmms_context->pending_read_reports->from_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_read_reports->from_p);
- }
- jdd_MemFree(g_jmms_context->pending_read_reports);
- g_jmms_context->pending_read_reports = node1;
- /* free the node for general message */
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- return;
- }
- } /* /switch(type) */
- mmi_jmms_free_pending_mms_info_node();
- g_jmms_context->pending_mms_info_list = node;
- Content.bIsStream = E_TRUE;
- eRet = mmi_jmms_get_message("Inbox", &Content, index);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to get messages from InBox.", eRet));
- DisplayPopup((PU8) GetString(STR_ID_JMMS_ERROR_GET_MSG_LIST), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
- goto END;
- }
- mmi_jmms_deinit_mms_context(g_jmms_context);
- eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->msg_handle);
- }
- /* Async changes end */
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms parsing failed!", eRet));
- if (g_jmms_context->msg_handle != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "Deinitializing the msg header."));
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- goto END;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, (MESSAGE_HEADERS **) (&g_jmms_context->MsgHeaders_p));
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to get the msg header", eRet));
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- goto END;
- }
- switch (((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->eMsgType)
- {
- case E_MSG_TYPE_RECEIVE:
- {
- g_jmms_context->MsgHeader_type_p =
- (MESSAGE_RETRIEVAL*) ((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->pHeaders;
- /* /for setting read status */
- mmi_jmms_set_msg_as_read((U8) (index - 1));
- g_jmms_context->mms_index = index;
- g_jmms_context->last_scr_id = IDLE_SCREEN_ID;
- g_jmms_context->is_unread_msg_deleted = 0;
- #ifdef __MMI_UNIFIED_MESSAGE__
- g_jmms_context->show_property_screen = MMI_FALSE;
- #endif
- mmi_jmms_handle_read_report(g_jmms_context->MsgHeader_type_p);
- break;
- }
- default:
- break;
- }
- if (Content.pFileName != NULL)
- {
- jdd_MemFree(Content.pFileName);
- Content.pFileName = NULL;
- }
- return;
- END:
- if (Content.pFileName != NULL)
- {
- jdd_MemFree(Content.pFileName);
- Content.pFileName = NULL;
- }
- //GoBackToHistory(IDLE_SCREEN_ID);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_read_report_header_for_idle_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * read_report_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_read_report_header_for_idle_screen(jmms_pending_mms_read_reports_struct *read_report_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- READ_REPORT_RESPONSE *read_report_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_create_read_report_header_for_idle_screen"));
- read_report_p = (READ_REPORT_RESPONSE*) jdd_MemAlloc(sizeof(READ_REPORT_RESPONSE), 1);
- if (read_report_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- read_report_p->eReadStatus = read_report_header->status;
- if (read_report_header->from_p != NULL)
- {
- read_report_p->pFrom =
- (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen((JC_CHAR*) (read_report_header->from_p)) + 1);
- if (read_report_p->pFrom == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(read_report_p->pFrom, (JC_CHAR*) (read_report_header->from_p));
- }
- read_report_p->uiReceivedTime = read_report_header->date;
- g_jmms_context->read_report_p = (READ_REPORT_RESPONSE*) (read_report_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && read_report_p != NULL)
- {
- mmi_jmms_free_report_report_header();
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "mmi_jmms_create_read_report_header_for_idle_screen Return value",
- eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_delivery_report_header_for_idle_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * delivery_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_delivery_report_header_for_idle_screen(
- jmms_pending_mms_delivery_reports_struct *delivery_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DELIVERY_REPORT *delivery_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_create_delivery_report_header_for_idle_screen"));
- mmi_jmms_free_delivery_report_header();
- delivery_p = (DELIVERY_REPORT*) jdd_MemAlloc(sizeof(DELIVERY_REPORT), 1);
- if (delivery_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- if (delivery_header->to_p != NULL)
- {
- delivery_p->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen((JC_CHAR*) (delivery_header->to_p)) + 1);
- if (delivery_p->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(delivery_p->pTo, (JC_CHAR*) (delivery_header->to_p));
- }
- delivery_p->eDeliveryStatus = delivery_header->status;
- delivery_p->uiDate = delivery_header->date;
- g_jmms_context->delivery_p = (DELIVERY_REPORT*) (delivery_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && delivery_p != NULL)
- {
- mmi_jmms_free_delivery_report_header();
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)",
- "mmi_jmms_create_delivery_report_header_for_idle_screen Return value", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_read_report
- * DESCRIPTION
- *
- * PARAMETERS
- * pMsgRetrieval [?] [?] [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_read_report(MESSAGE_RETRIEVAL *pMsgRetrieval)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 read_report_status;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS START 20060401 */
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_read_report"));
- mmi_jmms_update_status_icon_indicator();
- /* PMT VIKAS END 20060401 */
- if (pMsgRetrieval->bReadReport == MMI_TRUE)
- {
- read_report_status = mmi_jmms_retrieval_settings_read_report();
- switch (read_report_status)
- {
- case E_READ_REPORT_SEND_ON_REQUEST:
- mmi_jmms_show_read_report_query_screen();
- break;
- case E_READ_REPORT_SEND_ALWAYS:
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->show_property_screen == MMI_FALSE)
- {
- mmi_jmms_create_and_send_read_report();
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_play_mms();
- }
- }
- else
- {
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- mmi_jmms_create_and_send_read_report();
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- mmi_jmms_create_and_send_read_report();
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- break;
- case E_READ_REPORT_SEND_NEVER:
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->show_property_screen == MMI_FALSE)
- {
- mmi_jmms_play_mms();
- }
- else
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- break;
- }
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->show_property_screen == MMI_FALSE && g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_play_mms();
- }
- else
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- }
- DeleteScreenIfPresent(SCR_ID_JMMS_POP_SCREEN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_show_read_report_query_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_show_read_report_query_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_show_read_report_query_screen"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_READ_REPORT_QUERY);
- EntryNewScreen(SCR_ID_JMMS_READ_REPORT_QUERY, mmi_jmms_exit_read_report_query_screen, mmi_jmms_show_read_report_query_screen, NULL);
- ShowCategory165Screen(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_ID_JMMS_READ_REPORT_REQUEST),
- IMG_GLOBAL_QUESTION,
- guiBuffer);
- playRequestedTone(WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_jmms_handle_read_report_confirm, KEY_EVENT_UP);
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- SetRightSoftkeyFunction(mmi_jmms_entry_show_mms_screen, KEY_EVENT_UP);
- }
- else
- {
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_end_mms_play, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_exit_read_report_query_screen
- * DESCRIPTION
- * Exit fn for read report query confirmation screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_exit_read_report_query_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_read_report_confirm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_read_report_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->show_property_screen == MMI_FALSE)
- {
- mmi_jmms_create_and_send_read_report();
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_play_mms();
- }
- }
- else
- {
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- else
- {
- GoBackHistory();
- }
- mmi_jmms_create_and_send_read_report();
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (g_jmms_context->is_unread_msg_deleted == 0)
- {
- mmi_jmms_entry_show_mms_screen();
- }
- else
- {
- GoBackHistory();
- }
- mmi_jmms_create_and_send_read_report();
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_pending_mms_info_node
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_pending_mms_info_node(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_free_pending_mms_info_node"));
- if (g_jmms_context->pending_mms_info_list->mms_url != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_mms_info_list->mms_url);
- }
- jdd_MemFree(g_jmms_context->pending_mms_info_list);
- g_jmms_context->pending_mms_info_list = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_mms_pop_ups_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_mms_pop_ups_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_delete_mms_pop_ups_list();
- GoBackToHistory(IDLE_SCREEN_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_delete_mms_pop_ups_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_delete_mms_pop_ups_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_delete_mms_pop_ups_list"));
- if (g_jmms_context->pending_delivery_reports != NULL)
- {
- jmms_pending_mms_delivery_reports_struct *node1 = NULL;
- do
- {
- node1 = g_jmms_context->pending_delivery_reports->next;
- if (g_jmms_context->pending_delivery_reports->to_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_delivery_reports->to_p);
- }
- jdd_MemFree(g_jmms_context->pending_delivery_reports);
- g_jmms_context->pending_delivery_reports = node1;
- } while (node1 != NULL);
- }
- /* free all read reports nodes */
- if (g_jmms_context->pending_read_reports != NULL)
- {
- jmms_pending_mms_read_reports_struct *node1 = NULL;
- do
- {
- node1 = g_jmms_context->pending_read_reports->next;
- if (g_jmms_context->pending_read_reports->from_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_read_reports->from_p);
- }
- jdd_MemFree(g_jmms_context->pending_read_reports);
- g_jmms_context->pending_read_reports = node1;
- } while (node1 != NULL);
- }
- /* free all general mesage nodes */
- if (g_jmms_context->pending_mms_info_list != NULL)
- {
- jmms_pending_mms_info_struct *node1 = NULL;
- do
- {
- node1 = g_jmms_context->pending_mms_info_list->next;
- if (g_jmms_context->pending_mms_info_list->mms_url != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_mms_info_list->mms_url);
- }
- jdd_MemFree(g_jmms_context->pending_mms_info_list);
- g_jmms_context->pending_mms_info_list = node1;
- } while (node1 != NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_delete_mms_pop_ups_list_on_inbox_entry
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_delete_mms_pop_ups_list_on_inbox_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_delete_mms_pop_ups_list_on_inbox_entry"));
- if (g_jmms_context->pending_delivery_reports != NULL)
- {
- jmms_pending_mms_delivery_reports_struct *node1 = NULL;
- do
- {
- node1 = g_jmms_context->pending_delivery_reports->next;
- if (g_jmms_context->pending_delivery_reports->to_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_delivery_reports->to_p);
- }
- jdd_MemFree(g_jmms_context->pending_delivery_reports);
- g_jmms_context->pending_delivery_reports = node1;
- } while (node1 != NULL);
- }
- /* free all read reports nodes */
- if (g_jmms_context->pending_read_reports != NULL)
- {
- jmms_pending_mms_read_reports_struct *node1 = NULL;
- do
- {
- node1 = g_jmms_context->pending_read_reports->next;
- if (g_jmms_context->pending_read_reports->from_p != NULL)
- {
- jdd_MemFree(g_jmms_context->pending_read_reports->from_p);
- }
- jdd_MemFree(g_jmms_context->pending_read_reports);
- g_jmms_context->pending_read_reports = node1;
- } while (node1 != NULL);
- }
- /* free all general mesage nodes except E_MSG_TYPE_IDLE_SCREEN_POP_UP */
- if (g_jmms_context->pending_mms_info_list != NULL)
- {
- jmms_pending_mms_info_struct *node = NULL;
- jmms_pending_mms_info_struct *pre_node = NULL;
- node = g_jmms_context->pending_mms_info_list;
- pre_node = node;
- while (node != NULL)
- {
- if (node->type != E_MSG_TYPE_IDLE_SCREEN_POP_UP)
- {
- jmms_pending_mms_info_struct *next_node = NULL;
- next_node = node->next;
- if (g_jmms_context->pending_mms_info_list == node)
- {
- g_jmms_context->pending_mms_info_list = next_node;
- pre_node = next_node;
- }
- else
- {
- pre_node->next = node->next;
- }
- if (node->mms_url != NULL)
- {
- jdd_MemFree(node->mms_url);
- }
- jdd_MemFree(node);
- node = next_node;
- }
- else
- {
- pre_node = node;
- node = node->next;
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_show_read_report_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_show_read_report_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- S8 temp[14];
- U8 dttemp[40];
- MYTIME time;
- FLOAT timezone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_entry_show_read_report_screen"));
- timezone = mmi_dt_get_tz();
- EntryNewScreen(SCR_ID_JMMS_NEW_MMS, NULL, mmi_jmms_entry_show_read_report_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NEW_MMS);
- /* STATUS */
- pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_STATUS));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "jmms read status: ", g_jmms_context->read_report_p->eReadStatus));
- switch (g_jmms_context->read_report_p->eReadStatus)
- {
- case E_STATUS_READ:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms read status: E_STATUS_READ."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_READ_REPORT_READ));
- break;
- case E_STATUS_DELETED:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_READ_REPORT_DELETED));
- break;
- default:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
- break;
- }
- /* FROM */
- memset(temp, 0x00, 4);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (g_jmms_context->read_report_p->pFrom == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) (g_jmms_context->read_report_p->pFrom));
- }
- /* Date */
- memset(dttemp, 0x00, 40);
- date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- /* Time */
- memset(temp, 0x00, 6);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- memset(dttemp, 0x00, 40);
- time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- ShowCategory78Screen(
- STR_ID_SETTINGS_READ_REPORT,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- NULL,
- NULL,
- NULL,
- (U8*) subMenuData,
- pfnUnicodeStrlen((S8*) subMenuData),
- gui_buffer);
- SetLeftSoftkeyFunction(mmi_jmms_back_msg_view_entry, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_back_msg_view_entry, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_back_msg_view_entry, KEY_WAP, KEY_EVENT_DOWN);
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_end_mms_play, KEY_END, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_show_delivery_report_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_show_delivery_report_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- S8 temp[14];
- U8 dttemp[40];
- MYTIME time1, time;
- FLOAT timezone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_entry_show_delivery_report_screen"));
- timezone = mmi_dt_get_tz();
- /* sandeep start to Fix bug number PMT00006350 */
- mmi_jmms_update_status_icon_indicator();
- /* sandeep end to Fix bug number PMT00006350 */
- EntryNewScreen(SCR_ID_JMMS_NEW_MMS, NULL, mmi_jmms_entry_show_delivery_report_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NEW_MMS);
- /* STATUS */
- pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_STATUS));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- switch (g_jmms_context->delivery_p->eDeliveryStatus)
- {
- case E_MSG_EXPIRED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_EXPIRED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_EXPIRED));
- break;
- case E_MSG_RETRIEVED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_RETRIEVED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_RETRIEVED));
- break;
- case E_MSG_REJECTED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_REJECTED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_REJECTED));
- break;
- case E_MSG_DEFERRED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_DEFERRED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_DEFFERED));
- break;
- case E_MSG_UNRECOGNIZED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_UNRECOGNIZED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_UNRECOGNISED));
- break;
- case E_MSG_INDETERMINATE:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status:E_MSG_INDETERMINATE."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_INDETERMINATE));
- break;
- case E_MSG_FORWARDED:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_FORWARDED."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_FORWARDED));
- break;
- case E_MSG_UNREACHABLE:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms Delievery Status: E_MSG_UNREACHABLE."));
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_UNREACHABLE));
- break;
- default:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
- break;
- }
- /* TO */
- memset(temp, 0x00, 4);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (g_jmms_context->delivery_p->pTo == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) (g_jmms_context->delivery_p->pTo));
- }
- /* /Date */
- memset(temp, 0x00, 6);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- mmi_dt_utc_sec_2_mytime((U32) (g_jmms_context->delivery_p->uiDate), &time1, MMI_TRUE);
- mmi_dt_utc_to_rtc(timezone, time1, time);
- /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
- /* Date */
- memset(dttemp, 0x00, 40);
- date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- memset(temp, 0x00, 6);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- /* Time*/
- memset(dttemp, 0x00, 40);
- time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- /* End of Changes - RAJ KUMAR GUPTA */
- ShowCategory78Screen(
- STR_ID_JMMS_DELIVERY_REPORT,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- NULL,
- NULL,
- NULL,
- (U8*) subMenuData,
- pfnUnicodeStrlen((S8*) subMenuData),
- gui_buffer);
- SetLeftSoftkeyFunction(mmi_jmms_back_msg_view_entry, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_back_msg_view_entry, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_back_msg_view_entry, KEY_WAP, KEY_EVENT_DOWN);
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_end_mms_play, KEY_END, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_deffered_retrieved_mms
- * DESCRIPTION
- *
- * PARAMETERS
- * Content [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_deffered_retrieved_mms(CONTENT_DATA Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_deffered_retrieved_mms"));
- if (g_jmms_context->msg_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->msg_handle);
- };
- /* Async changes end */
- if (JC_OK != eRet && g_jmms_context->msg_handle != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms parsing failed! Deinitializing the Msg Handler.", eRet));
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- return eRet;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, (MESSAGE_HEADERS **) (&g_jmms_context->MsgHeaders_p));
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms failed to get the message Header.", eRet));
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- return eRet;
- }
- if ((((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->eMsgType) != E_MSG_TYPE_RECEIVE)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- return E_UNKNOWN_MSG;
- }
- g_jmms_context->MsgHeader_type_p =
- (MESSAGE_RETRIEVAL*) ((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->pHeaders;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "mmi_jmms_handle_deffered_retrieved_mms Return value", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * jmms_mmi_ack_for_deffered_retrieval
- * DESCRIPTION
- *
- * PARAMETERS
- * Content [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE jmms_mmi_ack_for_deffered_retrieval(CONTENT_DATA Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- MESSAGE_ACK *pAck = NULL;
- MESSAGE_RETRIEVAL *pNotifyIndHdrs = NULL;
- MSG_HANDLE mms_signal_handle = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "jmms_mmi_ack_for_deffered_retrieval"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&mms_signal_handle, &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(mms_signal_handle);
- };
- /* Async changes end */
- if (JC_OK != eRet && mms_signal_handle != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms parsing failed! Deinitializing the Msg Handler.", eRet));
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- return eRet;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(mms_signal_handle, &pMsgHeaders);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to get the Msg Header", eRet));
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- return eRet;
- }
- pNotifyIndHdrs = (MESSAGE_RETRIEVAL*) pMsgHeaders->pHeaders;
- if (pNotifyIndHdrs == NULL || pNotifyIndHdrs->pTransactionID == NULL || pNotifyIndHdrs->pVersion == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto ERROR_HANDLE;
- }
- pAck = (MESSAGE_ACK*) jdd_MemAlloc(sizeof(MESSAGE_ACK), 1);
- if (pAck == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pAck->bDeliveryReport = (JC_BOOLEAN) mmi_jmms_retrieval_settings_delivery_report();
- pAck->pVersion = jdi_UtilsStrdup(pNotifyIndHdrs->pVersion);
- pAck->pTransactionID = jdi_UtilsStrdup(pNotifyIndHdrs->pTransactionID);
- if (NULL != mms_signal_handle)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- }
- eRet = mmi_jmms_jdi_msg_init(&mms_signal_handle, NULL);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms Msg initialization failed.", eRet));
- mms_signal_handle = NULL;
- goto ERROR_HANDLE;
- }
- pMsgHeaders = (MESSAGE_HEADERS*) jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
- if (pMsgHeaders == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pMsgHeaders->eMsgType = E_MSG_TYPE_ACKNOWLEDGE;
- pMsgHeaders->pHeaders = pAck;
- eRet = mmi_jmms_jdi_set_msg_headers(mms_signal_handle, pMsgHeaders);
- if (JC_OK != eRet)
- {
- goto ERROR_HANDLE;
- }
- mmi_jmms_send_mms(mms_signal_handle, E_TYPE_ACK_RESPONSE, E_TRUE, 1, E_FALSE);
- ERROR_HANDLE:
- if (mms_signal_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(mms_signal_handle);
- mms_signal_handle = NULL;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms_mmi_ack_for_deffered_retrieval Return value", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_and_send_read_report
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_create_and_send_read_report(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MESSAGE_RETRIEVAL *pRetrieveHdrs = NULL;
- U16 temp_comm_state = E_TYPE_NULL;
- MSG_HANDLE read_report_handle = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_create_and_send_read_report"));
- pRetrieveHdrs = (MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p;
- if (jc_strcmp(pRetrieveHdrs->pVersion, "1.0") == 0)
- {
- eRet = mmi_jmms_set_read_reply_message(
- &read_report_handle,
- pRetrieveHdrs->pMessageID,
- pRetrieveHdrs->pFrom,
- pRetrieveHdrs->pSubject);
- if (eRet == JC_OK)
- {
- temp_comm_state = E_TYPE_READ_REPORT_MMS;
- }
- }
- else
- {
- eRet = mmi_jmms_set_read_reply_pdu(
- &read_report_handle,
- pRetrieveHdrs->pMessageID,
- pRetrieveHdrs->pFrom,
- pRetrieveHdrs->pVersion);
- if (eRet == JC_OK)
- {
- temp_comm_state = E_TYPE_READ_REPORT_PDU;
- }
- }
- if (eRet == JC_OK)
- {
- eRet = mmi_jmms_send_mms(read_report_handle, temp_comm_state, E_TRUE, 1, E_FALSE);
- }
- if (eRet != JC_OK)
- {
- if (eRet == E_JMMS_STORAGE_FULL)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_STORAGE_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- else /* /in case of error mmi_jmms_set_read_reply_pdu || */
- /* mmi_jmms_set_read_reply_message themselves will free the handle */
- {
- if (read_report_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(read_report_handle);
- read_report_handle = NULL;
- }
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_read_reply_message
- * DESCRIPTION
- *
- * PARAMETERS
- * phMsgHandle [?] [?] [?]
- * MessageID [?] [?] [?]
- * pToAddress [?] [?] [?]
- * pSubject [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_set_read_reply_message(
- MSG_HANDLE *phMsgHandle,
- JC_INT8 *MessageID,
- JC_CHAR *pToAddress,
- JC_CHAR *pSubject)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MESSAGE_HEADERS *pRRHeaders = NULL;
- MESSAGE_SEND *pRRSendHeaders = NULL;
- JC_UINT32 MediaId = 0;
- S8 *temp_string = NULL;
- U32 len = 0, temp_len = 0;
- MEDIA_INFO MediaInfo = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_set_read_reply_message"));
- if (phMsgHandle == NULL || MessageID == NULL || pToAddress == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_msg_init(phMsgHandle, NULL);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms msg initialization failed.", eRet));
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_set_msg_type(*phMsgHandle, E_TYPE_MMS);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to set the MMS type", eRet));
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_set_presentation_type(*phMsgHandle, E_PRESENTATION_NONE);
- if (JC_OK != eRet)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to set the presentation type", eRet));
- goto ERROR_HANDLE;
- }
- /* pMediaInfo = (MEDIA_INFO *)jdd_MemAlloc(sizeof(MEDIA_INFO), 1) ;
- if(pMediaInfo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION ;
- goto ERROR_HANDLE ;
- } */
- MediaInfo.eMediaType = E_MEDIA_TEXT;
- MediaInfo.pMimeInfo = (MEDIA_MIME_INFO*) jdd_MemAlloc(sizeof(MEDIA_MIME_INFO), 1);
- if (MediaInfo.pMimeInfo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- MediaInfo.pMimeInfo->MimeHeaders.pContentType =
- (JC_INT8*) jdd_MemAlloc(jc_strlen("text/plain") + 1, sizeof(JC_INT8));
- if (MediaInfo.pMimeInfo->MimeHeaders.pContentType == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- else
- {
- jc_strcpy(MediaInfo.pMimeInfo->MimeHeaders.pContentType, "text/plain");
- }
- if (g_jmms_context->is_unread_msg_deleted == 1)
- {
- len = (pfnUnicodeStrlen((S8*) GetString(STR_ID_JMMS_READ_REPORT_DELETE_MSG))) * ENCODING_LENGTH;
- }
- else
- {
- len = (pfnUnicodeStrlen((S8*) GetString(STR_ID_JMMS_READ_REPORT_MSG))) * ENCODING_LENGTH;
- }
- len = len + ((pfnUnicodeStrlen((S8*) GetString(STR_ID_JMMS_READ_REPORT_MSG_ID))) * ENCODING_LENGTH);
- temp_len = (strlen((const char*)MessageID)) * ENCODING_LENGTH;
- len = len + temp_len;
- MediaInfo.pMimeInfo->ContentData.pBuffer = jdd_MemAlloc(sizeof(S8), len + ENCODING_LENGTH);
- if (MediaInfo.pMimeInfo->ContentData.pBuffer == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- temp_string = jdd_MemAlloc(sizeof(S8), temp_len + ENCODING_LENGTH);
- if (temp_string == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- AnsiiToUnicodeString((S8*) temp_string, (S8*) MessageID);
- if (g_jmms_context->is_unread_msg_deleted == 1)
- {
- pfnUnicodeStrcpy(
- (S8*) (MediaInfo.pMimeInfo->ContentData.pBuffer),
- (S8*) GetString(STR_ID_JMMS_READ_REPORT_DELETE_MSG));
- g_jmms_context->is_unread_msg_deleted = 0;
- }
- else
- {
- pfnUnicodeStrcpy(
- (S8*) (MediaInfo.pMimeInfo->ContentData.pBuffer),
- (S8*) GetString(STR_ID_JMMS_READ_REPORT_MSG));
- }
- pfnUnicodeStrcat(
- (S8*) (MediaInfo.pMimeInfo->ContentData.pBuffer),
- (S8*) GetString(STR_ID_JMMS_READ_REPORT_MSG_ID));
- pfnUnicodeStrcat((S8*) (MediaInfo.pMimeInfo->ContentData.pBuffer), (S8*) temp_string);
- if (temp_string != NULL)
- {
- jdd_MemFree(temp_string);
- temp_string = NULL;
- }
- jdi_UtilsCharToTchar(&(MediaInfo.PresentationInfo.pRegionName), "Text");
- MediaInfo.pMimeInfo->ContentData.uiCurSize = MediaInfo.pMimeInfo->ContentData.uiTotalSize = len + ENCODING_LENGTH;
- eRet = mmi_jmms_jdi_add_media(*phMsgHandle, &MediaInfo, 1, &MediaId);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms fail to add media.", eRet));
- goto ERROR_HANDLE;
- }
- pRRHeaders = jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
- if (pRRHeaders == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pRRHeaders->eMsgType = E_MSG_TYPE_SEND;
- pRRSendHeaders = (MESSAGE_SEND*) jdd_MemAlloc(sizeof(MESSAGE_SEND), 1);
- if (pRRSendHeaders == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pRRSendHeaders->eMsgClass = E_MSG_AUTO_CLASS;
- pRRSendHeaders->eMsgPriority = (U32) E_MSG_PRIORITY_NORMAL;
- if (wap_get_user_agent_brand() == EM_WAP_USERAGENT_BRAND_SE)
- {
- pRRSendHeaders->uiDate = get_current_utc_time();
- pRRSendHeaders->uiExpiryTime = 0;
- }
- else
- {
- pRRSendHeaders->uiExpiryTime = (U32) MAX_VALIDITY_PERIOD_VALUE;
- }
- if (pSubject != NULL)
- {
- len = (pfnUnicodeStrlen((S8*) pSubject)) * ENCODING_LENGTH;
- len = len + ((strlen((S8*) STR_JMMS_READ_REPORT_PREPEND_STRING)) * ENCODING_LENGTH);
- pRRSendHeaders->pSubject = jdd_MemAlloc(sizeof(S8), (len + ENCODING_LENGTH ));
- if (pRRSendHeaders->pSubject == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- AnsiiToUnicodeString((S8*) pRRSendHeaders->pSubject, (S8*) STR_JMMS_READ_REPORT_PREPEND_STRING);
- pfnUnicodeStrcat((S8*) (pRRSendHeaders->pSubject), (S8*) (pSubject));
- }
- else
- {
- len =(strlen((S8*) STR_JMMS_READ_REPORT_PREPEND_STRING))* ENCODING_LENGTH;
- pRRSendHeaders->pSubject = jdd_MemAlloc(sizeof(S8), len + ENCODING_LENGTH );
- if (pRRSendHeaders->pSubject == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- AnsiiToUnicodeString((S8*) pRRSendHeaders->pSubject, (S8*) STR_JMMS_READ_REPORT_PREPEND_STRING);
- }
- pRRSendHeaders->pTo = jdd_MemAlloc(jc_tcslen(pToAddress) + 1, sizeof(JC_CHAR));
- if (pRRSendHeaders->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(pRRSendHeaders->pTo, pToAddress);
- pRRSendHeaders->pVersion = jdd_MemAlloc(sizeof(JC_INT8), MAX_VERSION_LENGTH + 1);
- if (pRRSendHeaders->pVersion)
- {
- jc_strcpy(pRRSendHeaders->pVersion, "1.0");
- }
- pRRHeaders->pHeaders = pRRSendHeaders;
- eRet = mmi_jmms_jdi_set_msg_headers(*phMsgHandle, pRRHeaders);
- ERROR_HANDLE:
- if (eRet != JC_OK)
- {
- if (*phMsgHandle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(*phMsgHandle);
- phMsgHandle = NULL;
- }
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "mmi_jmms_set_read_reply_message Return value", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_read_reply_pdu
- * DESCRIPTION
- *
- * PARAMETERS
- * phMsgHandle [?] [?] [?]
- * MessageID [?] [?] [?]
- * pToAddress [?] [?] [?]
- * pVersion [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_set_read_reply_pdu(
- MSG_HANDLE *phMsgHandle,
- JC_INT8 *MessageID,
- JC_CHAR *pToAddress,
- JC_INT8 *pVersion)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- READ_REPORT *pReadReport = NULL;
- MESSAGE_HEADERS *pReadReportPDU = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_set_read_reply_pdu"));
- if (phMsgHandle == NULL || MessageID == NULL || pToAddress == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto ERROR_HANDLE;
- }
- eRet = mmi_jmms_jdi_msg_init(phMsgHandle, NULL);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "jmms msg Initialization failed.", eRet));
- goto ERROR_HANDLE;
- }
- pReadReportPDU = (MESSAGE_HEADERS*) jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
- if (pReadReportPDU == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- pReadReport = (READ_REPORT*) jdd_MemAlloc(sizeof(READ_REPORT), 1);
- if (pReadReport == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- if (g_jmms_context->is_unread_msg_deleted == 1)
- {
- pReadReport->eReadStatus = E_STATUS_DELETED;
- g_jmms_context->is_unread_msg_deleted = 0;
- }
- else
- {
- pReadReport->eReadStatus = E_STATUS_READ;
- }
- pReadReport->pMessageID = jdi_UtilsStrdup(MessageID);
- pReadReport->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(pToAddress) + 1);
- if (pReadReport->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(pReadReport->pTo, pToAddress);
- pReadReport->pVersion = jdi_UtilsStrdup(pVersion);
- if (wap_get_user_agent_brand() == EM_WAP_USERAGENT_BRAND_SE)
- {
- pReadReport->uiDate = get_current_utc_time();
- }
- pReadReportPDU->eMsgType = E_MSG_TYPE_READ_REPORT;
- pReadReportPDU->pHeaders = pReadReport;
- eRet = mmi_jmms_jdi_set_msg_headers(*phMsgHandle, pReadReportPDU);
- ERROR_HANDLE:
- if (eRet != JC_OK)
- {
- if (*phMsgHandle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(*phMsgHandle);
- phMsgHandle = NULL;
- }
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "mmi_jmms_set_read_reply_pdu Return value", eRet));
- return eRet;
- }
- #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */