BeepPadUI/Workflow/shared/messaging.js
// test if the message type is matching
test if the message type is matching
test if the message type is matching
function IsMessageTypeMatches(strMsgTypesFilter, strMsgType, strMsgSubTypeLevel1, strMsgIDList,strMsgID)
{             
    var bRet = false;
    if ( strMsgIDList != null && strMsgIDList.length > 0)
    {
        var i =  0;
        for ( i = 0; i < strMsgIDList.length; i++)
        {
            if ( strMsgID == strMsgIDList[i])
            {
                bRet  = true;
                break;
            }
        }
    } 
    else if (strMsgTypesFilter != null && strMsgTypesFilter.length > 0)
    {
        var i =  0;
        for ( i = 0; i < strMsgTypesFilter.length; i++)
        {
            if ( strMsgType == strMsgTypesFilter[i])
            {
                bRet  = true;
                break;
            }
        }
    }
    else
    {
        if ( strMsgType == "download")
        {
            bRet = true;
        }
        if ( strMsgType == "update")
        {
            bRet = true;
        }
        if ( strMsgSubTypeLevel1== null || strMsgSubTypeLevel1 == "")
        {
            bRet = true;
        }
    }
    return bRet;
}
function IsMessageTypeMatches ( strMsgTypesFilter , strMsgType , strMsgSubTypeLevel1 , strMsgIDList , strMsgID ) { var bRet = false ; if ( strMsgIDList != null && strMsgIDList . length > 0 ) { var i = 0 ; for ( i = 0 ; i < strMsgIDList . length ; i ++ ) { if ( strMsgID == strMsgIDList [ i ] ) { bRet = true ; break ; } } } else if ( strMsgTypesFilter != null && strMsgTypesFilter . length > 0 ) { var i = 0 ; for ( i = 0 ; i < strMsgTypesFilter . length ; i ++ ) { if ( strMsgType == strMsgTypesFilter [ i ] ) { bRet = true ; break ; } } } else { if ( strMsgType == "download" ) { bRet = true ; } if ( strMsgType == "update" ) { bRet = true ; } if ( strMsgSubTypeLevel1 == null || strMsgSubTypeLevel1 == "" ) { bRet = true ; } } return bRet ; }
test if the message type is matching
test if the message type is matching
// had message id list filter // not Category or MsgIDList filter