summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-11-27 11:42:17 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-11-27 11:42:17 +0200
commite8421572d01640f1fac0d8a0f04c85db35fe3b51 (patch)
treebddf8f51e001f0da0f888c0bf5d91847dff2a8e2
parent27f5fece0343ac3f140c46211671c275795a2877 (diff)
fix for major task EXT-2894 Add support for the viewer 1.23 chat history style (widget-less) - Nearby Chat
--HG-- branch : product-engine
-rw-r--r--indra/newview/llnearbychat.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 80a6cc343f..d1e3713471 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -130,6 +130,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)
{
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
@@ -150,11 +165,18 @@ void LLNearbyChat::addMessage(const LLChat& chat)
return;
}
}
+
+ bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory");
if (!chat.mMuted)
{
std::string message = chat.mText;
- std::string prefix = message.substr(0, 4);
+
+
+ LLChat& tmp_chat = const_cast<LLChat&>(chat);
+
+ if(tmp_chat.mTimeStr.empty())
+ tmp_chat.mTimeStr = appendTime();
if (chat.mChatStyle == CHAT_STYLE_IRC)
{
@@ -173,7 +195,7 @@ void LLNearbyChat::addMessage(const LLChat& chat)
append_style_params.font.style = "ITALIC";
LLChat add_chat=chat;
add_chat.mText = chat.mFromName + " ";
- mChatHistory->appendMessage(add_chat, false, append_style_params);
+ mChatHistory->appendMessage(add_chat, use_plain_text_chat_history, append_style_params);
}
message = message.substr(3);
@@ -182,7 +204,7 @@ void LLNearbyChat::addMessage(const LLChat& chat)
}
else
{
- mChatHistory->appendMessage(chat);
+ mChatHistory->appendMessage(chat,use_plain_text_chat_history);
}
}
}