From 9e0e0e4d54c73288a159beae3a654771a75f3714 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 30 Nov 2009 15:35:48 +0200 Subject: no ticket. addition to "(EXT-2894)- Add support for the viewer 1.23 chat history style (widget-less)" change all messages style when chaning chat style in preference. --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') 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::iterator it = mMessageArchive.begin();it!=mMessageArchive.end();++it) + { + addMessage(*it,false); + } +} +//static +void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) +{ + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); + if(nearby_chat) + nearby_chat->updateChatHistoryStyle(); +} -- cgit v1.2.3 From 62feea50c2f430f65ad7ab16cfa5e66b2b2e2b63 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 3 Dec 2009 10:31:00 +0200 Subject: fix for normal EXT-3077 [BSI] Object chat of objects without a name bork nearby chat toasts and log for information - since I think that messages from nowhere is bad practice for user - if object that send message has no name I use object id as name --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index ee3be0a5e3..fda3df43ae 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -54,7 +54,7 @@ #include "llstylemap.h" #include "lldraghandle.h" -#include "lltrans.h" + #include "llbottomtray.h" #include "llnearbychatbar.h" #include "llfloaterreg.h" @@ -131,20 +131,6 @@ void LLNearbyChat::applySavedVariables() } } -std::string appendTime() -{ - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; - - LLSD substitution; - - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - - return timeStr; -} void LLNearbyChat::addMessage(const LLChat& chat,bool archive) { @@ -171,14 +157,6 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) if (!chat.mMuted) { - std::string message = chat.mText; - - - LLChat& tmp_chat = const_cast(chat); - - if(tmp_chat.mTimeStr.empty()) - tmp_chat.mTimeStr = appendTime(); - if (chat.mChatStyle == CHAT_STYLE_IRC) { LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); @@ -191,17 +169,9 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) append_style_params.readonly_color(txt_color); append_style_params.font.name(font_name); append_style_params.font.size(font_size); - if (chat.mFromName.size() > 0) - { - append_style_params.font.style = "ITALIC"; - LLChat add_chat=chat; - add_chat.mText = chat.mFromName + " "; - mChatHistory->appendMessage(add_chat, use_plain_text_chat_history, append_style_params); - } - - message = message.substr(3); append_style_params.font.style = "ITALIC"; - mChatHistory->appendText(message, FALSE, append_style_params); + + mChatHistory->appendMessage(chat, use_plain_text_chat_history, append_style_params); } else { -- cgit v1.2.3 From 37e547b67d262c5007e0beee703e578d6f3073bf Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 3 Dec 2009 13:46:04 +0200 Subject: no ticket. system messages where without time after changeset 5886:8987aefb8b91 --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index fda3df43ae..18e5169930 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -58,6 +58,7 @@ #include "llbottomtray.h" #include "llnearbychatbar.h" #include "llfloaterreg.h" +#include "lltrans.h" static const S32 RESIZE_BAR_THICKNESS = 3; @@ -131,6 +132,21 @@ void LLNearbyChat::applySavedVariables() } } +std::string appendTime() +{ + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" + +LLTrans::getString("TimeMin")+"] "; + + LLSD substitution; + + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + + return timeStr; +} + void LLNearbyChat::addMessage(const LLChat& chat,bool archive) { @@ -153,6 +169,11 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) } } + LLChat& tmp_chat = const_cast(chat); + + if(tmp_chat.mTimeStr.empty()) + tmp_chat.mTimeStr = appendTime(); + bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); if (!chat.mMuted) -- cgit v1.2.3