aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lllogchat.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:59 -0500
committerJacek Antonelli2008-08-15 23:44:59 -0500
commita408bac29378072fbf36864164149458c978cfcc (patch)
tree67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/newview/lllogchat.cpp
parentSecond Life viewer sources 1.17.0.12 (diff)
downloadmeta-impy-a408bac29378072fbf36864164149458c978cfcc.zip
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz
Second Life viewer sources 1.17.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lllogchat.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/linden/indra/newview/lllogchat.cpp b/linden/indra/newview/lllogchat.cpp
index aaa19ea..ec9b9f5 100644
--- a/linden/indra/newview/lllogchat.cpp
+++ b/linden/indra/newview/lllogchat.cpp
@@ -29,18 +29,40 @@
29#include "llviewerprecompiledheaders.h" 29#include "llviewerprecompiledheaders.h"
30 30
31#include "lllogchat.h" 31#include "lllogchat.h"
32 32#include "viewer.h"
33
33const S32 LOG_RECALL_SIZE = 2048; 34const S32 LOG_RECALL_SIZE = 2048;
34 35
35//static 36//static
36LLString LLLogChat::makeLogFileName(LLString filename) 37LLString LLLogChat::makeLogFileName(LLString filename)
37{ 38{
38
39 filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename.c_str()); 39 filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename.c_str());
40 filename += ".txt"; 40 filename += ".txt";
41 return filename; 41 return filename;
42} 42}
43 43
44LLString LLLogChat::timestamp(bool withdate)
45{
46 U32 utc_time;
47 utc_time = time_corrected();
48
49 // There's only one internal tm buffer.
50 struct tm* timep;
51
52 // Convert to Pacific, based on server's opinion of whether
53 // it's daylight savings time there.
54 timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);
55
56 LLString text;
57 if (withdate)
58 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);
59 else
60 text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min);
61
62 return text;
63}
64
65
44//static 66//static
45void LLLogChat::saveHistory(LLString filename, LLString line) 67void LLLogChat::saveHistory(LLString filename, LLString line)
46{ 68{