⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jmmsumhandling.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
        else
        {
            (*mms_info_p)->address_type = UM_ADDR_TYPE_PHONE_NUMBER;
        }
        pfnUnicodeStrncpy((S8*) (*mms_info_p)->address, (S8*) (from_p + start_index), len_to_copy);
        (*mms_info_p)->address_length = len_to_copy;
        return;

    }
    (*mms_info_p)->address_length = len_to_copy;
    return;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_jmms_at_delete_pre_set
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_um_jmms_at_delete_pre_set(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_jmms_context->msg_open_status[0] = 0;
    g_jmms_context->msg_open_status[1] = 0;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_jmms_store_update_message
 * DESCRIPTION
 *  
 * PARAMETERS
 *  pFolderName         [?]         
 *  uiExtraBytes        [IN]        
 *  media_count         [IN]        
 *  uiMsgIndex          [IN]        
 * RETURNS
 *  
 *****************************************************************************/
JC_RETCODE mmi_um_jmms_store_update_message(
            S8 *pFolderName,
            JC_UINT32 uiExtraBytes,
            U8 media_count,
            JC_UINT32 uiMsgIndex)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MESSAGE_HEADERS *pMsgHeaders = NULL;
    JC_RETCODE eRet = JC_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
    if (eRet != JC_OK || pMsgHeaders == NULL)
    {
        return eRet;
    }

    if (media_count > 0)
    {
        uiExtraBytes = uiExtraBytes | 0x01000000;
        mmi_um_update_status_attachment(
            g_jmms_context->g_attachment_pending_list->index_to_parse,
            E_JMMS_ATTACHMENT_PRESENT);
    }
    else
    {
        uiExtraBytes = uiExtraBytes | 0x02000000;
        mmi_um_update_status_attachment(
            g_jmms_context->g_attachment_pending_list->index_to_parse,
            E_JMMS_ATTACHMENT_NOT_PRESENT);
    }
    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_store_update_message_extrabyte(pFolderName, uiMsgIndex, uiExtraBytes);
    return eRet;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_free_attacment_pending_status_list
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_free_attacment_pending_status_list(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    um_jmms_attachment_present_list *temp_pending_list_p = g_jmms_context->g_attachment_pending_list;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    while (temp_pending_list_p != NULL)
    {
        g_jmms_context->g_attachment_pending_list = g_jmms_context->g_attachment_pending_list->next;
        jdd_MemFree(temp_pending_list_p);
        temp_pending_list_p = g_jmms_context->g_attachment_pending_list;
    }
    temp_pending_list_p = NULL;
    g_jmms_context->g_attachment_pending_list = NULL;
    return;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_jmms_add_new_node_attachment_pending_list
 * DESCRIPTION
 *  
 * PARAMETERS
 *  temp_pending_list_p     [?]     
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_um_jmms_add_new_node_attachment_pending_list(um_jmms_attachment_present_list *temp_pending_list_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    um_jmms_attachment_present_list *pending_list_p = g_jmms_context->g_attachment_pending_list;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (pending_list_p == NULL)
    {
        g_jmms_context->g_attachment_pending_list = temp_pending_list_p;
    }
    else
    {
        while (pending_list_p->next != NULL)
        {
            pending_list_p = pending_list_p->next;
        }
        pending_list_p->next = temp_pending_list_p;
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_jmms_parse_attachment_async_callback
 * DESCRIPTION
 *  
 * PARAMETERS
 *  eRet        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_um_jmms_parse_attachment_async_callback(JC_RETCODE eRet)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 media_count = 0;
    U32 uiExtraBytes = 0;
    mmi_um_get_list_rsp_struct *mms_info_rsp = NULL;
    um_jmms_attachment_present_list *temp_pending_list_p = NULL;
    U8 number = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mms_info_rsp = (mmi_um_get_list_rsp_struct*) g_um_jmms_rsp_struct;

    temp_pending_list_p = g_jmms_context->g_attachment_pending_list;

    if (temp_pending_list_p != NULL && eRet == JC_OK)
    {
        mmi_jmms_jdi_get_media_count(g_jmms_context->msg_handle, 0, &media_count, E_TRUE);
        switch (mms_info_rsp->msg_box_type)
        {
            case UM_MSG_BOX_TYPE_INBOX:
                mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
                uiExtraBytes =
                    (U32) mmi_jmms_get_message_id(MMI_JMMS_INBOX, (U16) (number - temp_pending_list_p->index_to_parse));
                eRet = mmi_um_jmms_store_update_message(
                        MMI_JMMS_INBOX,
                        uiExtraBytes,
                        media_count,
                        (number - temp_pending_list_p->index_to_parse));
                break;
            case UM_MSG_BOX_TYPE_UNSENT:
                mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
                uiExtraBytes =
                    (U32) mmi_jmms_get_message_id(
                            MMI_JMMS_OUTBOX,
                            (U16) (number - temp_pending_list_p->index_to_parse));
                eRet = mmi_um_jmms_store_update_message(
                        MMI_JMMS_OUTBOX,
                        uiExtraBytes,
                        media_count,
                        (number - temp_pending_list_p->index_to_parse));
                break;
            case UM_MSG_BOX_TYPE_SENT:
                mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
                uiExtraBytes =
                    (U32) mmi_jmms_get_message_id(MMI_JMMS_SENT, (U16) (number - temp_pending_list_p->index_to_parse));
                eRet = mmi_um_jmms_store_update_message(
                        MMI_JMMS_SENT,
                        uiExtraBytes,
                        media_count,
                        (number - temp_pending_list_p->index_to_parse));
                break;
            case UM_MSG_BOX_TYPE_DRAFT:
                mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
                uiExtraBytes =
                    (U32) mmi_jmms_get_message_id(
                            MMI_JMMS_DRAFTS,
                            (U16) (number - temp_pending_list_p->index_to_parse));
                eRet = mmi_um_jmms_store_update_message(
                        MMI_JMMS_DRAFTS,
                        uiExtraBytes,
                        media_count,
                        (number - temp_pending_list_p->index_to_parse));
        }
    }
    if (g_jmms_context->pParseContent != NULL)
    {
        if (g_jmms_context->pParseContent->pFileName != NULL)
        {
            jdd_MemFree(g_jmms_context->pParseContent->pFileName);
            g_jmms_context->pParseContent->pFileName = NULL;
        }
        jdd_MemFree(g_jmms_context->pParseContent);
        g_jmms_context->pParseContent = NULL;
    }

    if (g_jmms_context->msg_handle != NULL)
    {
        mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
        g_jmms_context->msg_handle = NULL;
    }

    /* if (eRet!=JC_OK)
       {
       mmi_jmms_free_attacment_pending_status_list();
       mmi_um_jmms_get_message_list_rsp();
       return;
       } */

    if (temp_pending_list_p != NULL)
    {
        g_jmms_context->g_attachment_pending_list = g_jmms_context->g_attachment_pending_list->next;
        jdd_MemFree(temp_pending_list_p);
        temp_pending_list_p = NULL;
        if (g_jmms_context->g_attachment_pending_list != NULL)
        {
            mmi_um_jmms_parse_mms_for_attachment();
        }
        else
        {
            mmi_um_jmms_get_message_list_rsp();
        }
    }
    else
    {
        mmi_um_jmms_get_message_list_rsp();
    }
    return;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_update_status_attachment
 * DESCRIPTION
 *  
 * PARAMETERS
 *  msg_index               [IN]        
 *  attachment_status       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_um_update_status_attachment(U16 msg_index, mmi_jmms_mms_attachment_status_enum attachment_status)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    jmms_folder_msgs_list *msg_list_p = g_jmms_context->store_context->messages_list;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    while (msg_list_p != NULL)
    {
        if (msg_list_p->um_msg_info->msg_index == msg_index)
        {
            msg_list_p->attachment_status = attachment_status;
            return;
        }
        msg_list_p = msg_list_p->next;
    }
    return;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_um_jmms_get_fill_list_info
 * DESCRIPTION
 *  
 * PARAMETERS
 *  mms_info_rsp        [?]     
 *  msg_info_req        [?]     
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_um_jmms_get_fill_list_info(
        mmi_um_get_msg_info_rsp_struct *mms_info_rsp,
        mmi_um_get_msg_info_req_struct *msg_info_req)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U32 tzdiff = 0;
    S32 msg_counter = 0;
    jmms_folder_msgs_list *msg_list_p = g_jmms_context->store_context->messages_list;
    S8 *name = NULL;
    applib_time_struct time;
    FLOAT tz;
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    tz = mmi_dt_get_tz();
    if(tz < 0)
    {
        time = applib_conv_tz_to_mytime(tz * (-1));
    }
    else
    {
        time = applib_conv_tz_to_mytime(tz);
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -