From 4bf428c4ee17d30f16bec26404fa70db22f3b059 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Wed, 2 Dec 2009 11:58:27 +0200 Subject: fix major EXT-3003 IM messages loaded from a chat history are displayed with current time --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 078c2518c6..c7d72ec01a 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -267,30 +267,13 @@ protected: } private: - std::string appendTime(const LLChat& chat) - { - 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 setTimeField(const LLChat& chat) { LLTextBox* time_box = getChild("time_box"); LLRect rect_before = time_box->getRect(); - std::string time_value = appendTime(chat); - - time_box->setValue(time_value); + time_box->setValue(chat.mTimeStr); // set necessary textbox width to fit all text time_box->reshapeToFitText(); -- cgit v1.2.3 From 003b6f19506e5934b052f81d9ef1b88bf5ad486d Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 3 Dec 2009 09:23:53 +0200 Subject: fix for normal EXT-2944 [BSI] Object chat and Resident chat is combined in Nearby Chat floater when object and Resident share the same name --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5e17770314..5f1bbc7615 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -355,6 +355,7 @@ void LLChatHistory::clear() { mLastFromName.clear(); LLTextEditor::clear(); + mLastFromID = LLUUID::null; } void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_chat_history, const LLStyle::Params& input_append_params) @@ -389,9 +390,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ LLDate new_message_time = LLDate::now(); - if (mLastFromName == chat.mFromName && - mLastMessageTime.notNull() && - (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 ) + if (mLastFromName == chat.mFromName + && mLastFromID == chat.mFromID + && mLastMessageTime.notNull() + && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 + ) { view = getSeparator(); p.top_pad = mTopSeparatorPad; @@ -419,6 +422,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ appendWidget(p, header_text, false); mLastFromName = chat.mFromName; + mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; } //Handle IRC styled /me messages. -- cgit v1.2.3 From 276b782b8cfd7c814b84bbbf51fba5007f6c6031 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Thu, 3 Dec 2009 18:31:48 +0200 Subject: Implemented normal sub-task EXT-3035 (Made other participants' names clickable in IM chat log (old school chat log style)) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5f1bbc7615..96b5ae5908 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -43,6 +43,7 @@ #include "lltrans.h" #include "llfloaterreg.h" #include "llmutelist.h" +#include "llstylemap.h" #include "llsidetray.h"//for blocked objects panel @@ -372,13 +373,25 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - std::string header_text = "[" + chat.mTimeStr + "] "; - if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; - if (use_plain_text_chat_history) { - appendText(header_text, getText().size() != 0, style_params); + appendText("[" + chat.mTimeStr + "] ", getText().size() != 0, style_params); + + if (utf8str_trim(chat.mFromName).size() != 0) + { + // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. + if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() ) + { + LLStyle::Params link_params(style_params); + link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); + // Convert the name to a hotlink and add to message. + appendText(chat.mFromName + ": ", false, link_params); + } + else + { + appendText(chat.mFromName + ": ", false, style_params); + } + } } else { @@ -420,6 +433,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); + std::string header_text = "[" + chat.mTimeStr + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + header_text += chat.mFromName + ": "; + appendWidget(p, header_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; -- cgit v1.2.3