示例#1
0
BOOL MfdKeywordFloaterStart::hasKeyword(std::string msg,int source)
{
	if(!gSavedPerAccountSettings.getBOOL("Meta7KeywordOn"))return FALSE;

// 	if((source ==3) && (gSavedPerAccountSettings.getBOOL("Meta7KeywordInGroup")))
// 		return containsKeyWord(msg);
// 	if((source ==4) && (gSavedPerAccountSettings.getBOOL("Meta7KeywordInIRC")))
// 		return containsKeyWord(msg);
	if((source == 1) && (gSavedPerAccountSettings.getBOOL("Meta7KeywordInChat")))
		return containsKeyWord(msg);
	if((source == 2) && (gSavedPerAccountSettings.getBOOL("Meta7KeywordInIM")))
		return containsKeyWord(msg);
	return FALSE;
	
}
BOOL AscentKeyword::hasKeyword(std::string msg,int source)
{
    static const LLCachedControl<bool> mKeywordsOn("KeywordsOn", false, gSavedPerAccountSettings);
    static const LLCachedControl<bool> mKeywordsInChat("KeywordsInChat", false, gSavedPerAccountSettings);
    static const LLCachedControl<bool> mKeywordsInIM("KeywordsInIM", false, gSavedPerAccountSettings);

    if (mKeywordsOn)
    {
        if ((source == 1) && (mKeywordsInChat))
        {
            return containsKeyWord(msg);
        }

        if ((source == 2) && (mKeywordsInIM))
        {
            return containsKeyWord(msg);
        }
    }

    return FALSE;
}