Example #1
0
//根据过滤规则对收到的信息进行过滤,返回过滤后的类型
Message::Box Filter::messageFilter(const QString& senderPhoneNum, const QString &messageContent)
{
    Message::Box messageBox(Message::Box_Inbox);

    int filterMode = g_setting->getFilterMode();
    switch (filterMode) {
    case FM_Unused:
        if (keyWordsFilter(messageContent))
            messageBox = Message::Box_Dustbin;
        else
            messageBox = Message::Box_Inbox;
        break;
    case FM_Blacklist:
        if (!blackListFilter(senderPhoneNum) &&
                !keyWordsFilter(messageContent))
            messageBox = Message::Box_Inbox;
        else
            messageBox = Message::Box_Dustbin;
        break;
    case FM_Whitelist:
        if (whiteListFilter(senderPhoneNum) &&
                !keyWordsFilter(messageContent))
            messageBox = Message::Box_Inbox;
        else
            messageBox = Message::Box_Dustbin;
        break;
    default:
        break;
    }

    return messageBox;
}
Example #2
0
static void filterNonComparative(struct cDnaQuery *cdna)
/* apply non-comparative filters */
{
/* n.b. order must agree with doc in algo.txt */
if (gBlackListRanges)
    blackListFilter(cdna);
if (gValidate)
    invalidPslFilter(cdna);
if (gMinQSize > 0)
    minQSizeFilter(cdna);
if (gMinAlnSize > 0)
    alnSizeFilter(cdna);
if (gMinNonRepSize > 0)
    nonRepSizeFilter(cdna);
if (gMaxRepMatch < 1.0)
    repMatchFilter(cdna);
if (gMinId > 0.0)
    identFilter(cdna);
if (gMinCover > 0.0)
    coverFilter(cdna);
if (gDecayMinCover)
    decayCoverFilter(cdna);
if (gBestOverlap)
    overlapFilterOverlapping(cdna);
if (gMinSpan > 0.0)
    minSpanFilter(cdna);
}