Chat keyword highlighting

This commit is contained in:
TighMacFanatic
2011-05-01 02:31:05 -04:00
parent 9a8a28ee1a
commit 56c357911e
10 changed files with 388 additions and 16 deletions

View File

@@ -74,6 +74,7 @@
#include "llhttpclient.h"
#include "llmutelist.h"
#include "llstylemap.h"
#include "ascentkeyword.h"
#include "boost/algorithm/string.hpp"
@@ -1592,8 +1593,23 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids)
return TRUE;
}
void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4& color, bool log_to_file, const LLUUID& source, const std::string& name)
void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name)
{
static const LLCachedControl<bool> mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings);
static const LLCachedControl<LLColor4> mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings);
if (gAgent.getID() != source)
{
if (mKeywordsChangeColor)
{
if (AscentKeyword::hasKeyword(utf8msg, 2))
{
incolor = mKeywordsColor;
}
}
}
const LLColor4& color = incolor;
// start tab flashing when receiving im for background session from user
if (source != LLUUID::null)
{