summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.cpp
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2007-06-21 22:40:22 +0000
committerKelly Washington <kelly@lindenlab.com>2007-06-21 22:40:22 +0000
commite03bb0606a10f29c8b94909a713a5bb5c69e88b7 (patch)
tree6d8d07894579438c8cc70e08f5730c3c95dfe768 /indra/newview/lllogchat.cpp
parent2638f12f95eea692502836cf6548b4a0b234d009 (diff)
merge -r62831:64079 branches/maintenance to release
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r--indra/newview/lllogchat.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 2c26fede2d..5e77a2f7f9 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -9,18 +9,40 @@
#include "llviewerprecompiledheaders.h"
#include "lllogchat.h"
-
+#include "viewer.h"
+
const S32 LOG_RECALL_SIZE = 2048;
//static
LLString LLLogChat::makeLogFileName(LLString filename)
{
-
filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename.c_str());
filename += ".txt";
return filename;
}
+LLString LLLogChat::timestamp(bool withdate)
+{
+ U32 utc_time;
+ utc_time = time_corrected();
+
+ // There's only one internal tm buffer.
+ struct tm* timep;
+
+ // Convert to Pacific, based on server's opinion of whether
+ // it's daylight savings time there.
+ timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);
+
+ LLString text;
+ if (withdate)
+ text = llformat("[%d/%02d/%02d %d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min);
+ else
+ text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min);
+
+ return text;
+}
+
+
//static
void LLLogChat::saveHistory(LLString filename, LLString line)
{