summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-12-02 12:52:13 -0800
committerSteve Bennetts <steve@lindenlab.com>2009-12-02 12:52:13 -0800
commit7bb862c8c1aa56fea6e533d5a257b3d39b428cac (patch)
tree6a66c190788be7c2b9797e682c5c09037a95729a /indra/newview/llnearbychat.cpp
parent6d3ca60f310e50b217a189086b652dca2e3e3854 (diff)
parentd550339958c14f0d7fd222a8531df639eac49e63 (diff)
Merge
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 8f1dec1431..ee3be0a5e3 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -57,6 +57,7 @@
#include "lltrans.h"
#include "llbottomtray.h"
#include "llnearbychatbar.h"
+#include "llfloaterreg.h"
static const S32 RESIZE_BAR_THICKNESS = 3;
@@ -145,7 +146,7 @@ std::string appendTime()
return timeStr;
}
-void LLNearbyChat::addMessage(const LLChat& chat)
+void LLNearbyChat::addMessage(const LLChat& chat,bool archive)
{
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
{
@@ -207,6 +208,13 @@ void LLNearbyChat::addMessage(const LLChat& chat)
mChatHistory->appendMessage(chat,use_plain_text_chat_history);
}
}
+
+ if(archive)
+ {
+ mMessageArchive.push_back(chat);
+ if(mMessageArchive.size()>200)
+ mMessageArchive.erase(mMessageArchive.begin());
+ }
}
void LLNearbyChat::onNearbySpeakers()
@@ -256,3 +264,19 @@ void LLNearbyChat::getAllowedRect(LLRect& rect)
{
rect = gViewerWindow->getWorldViewRectScaled();
}
+
+void LLNearbyChat::updateChatHistoryStyle()
+{
+ mChatHistory->clear();
+ for(std::vector<LLChat>::iterator it = mMessageArchive.begin();it!=mMessageArchive.end();++it)
+ {
+ addMessage(*it,false);
+ }
+}
+//static
+void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
+{
+ LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+ if(nearby_chat)
+ nearby_chat->updateChatHistoryStyle();
+}