no ticket. system messages where without time after changeset 5886:8987aefb8b91

--HG--
branch : product-engine
meow-7.2.2
Yuri Chebotarev 2009-12-03 13:46:04 +02:00
parent 032675b5dd
commit 37e547b67d
2 changed files with 21 additions and 18 deletions

View File

@ -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<LLChat&>(chat);
if(tmp_chat.mTimeStr.empty())
tmp_chat.mTimeStr = appendTime();
bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory");
if (!chat.mMuted)

View File

@ -42,7 +42,6 @@
#include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance
#include "llviewerwindow.h"//for screen channel position
#include "lltrans.h"
//add LLNearbyChatHandler to LLNotificationsUI namespace
using namespace LLNotificationsUI;
@ -319,20 +318,6 @@ void LLNearbyChatHandler::initChannel()
mChannel->init(channel_right_bound - channel_width, channel_right_bound);
}
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 LLNearbyChatHandler::processChat(const LLChat& chat_msg)
@ -347,9 +332,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg)
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
if(tmp_chat.mTimeStr.empty())
tmp_chat.mTimeStr = appendTime();
if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)
{
if(!tmp_chat.mFromName.empty())