Skip to content
Snippets Groups Projects
Commit 28d6ff35 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Restore chat timestamp option

parent 9fbe2758
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -433,7 +433,10 @@ std::string LLFloaterIMSessionTab::appendTime() ...@@ -433,7 +433,10 @@ std::string LLFloaterIMSessionTab::appendTime()
time_t utc_time = time_corrected(); time_t utc_time = time_corrected();
static const std::string time_str = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin")); static const std::string time_str = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
std::string timeStr = time_str; static const std::string time_str_seconds = fmt::format(FMT_STRING("[{}]:[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
static const LLCachedControl<bool> show_timestamp_seconds(gSavedSettings, "ChatTimestampSeconds", false);
std::string timeStr = show_timestamp_seconds ? time_str_seconds : time_str;
LLSD substitution; LLSD substitution;
substitution["datetime"] = (S32) utc_time; substitution["datetime"] = (S32) utc_time;
......
...@@ -301,16 +301,20 @@ std::string LLLogChat::cleanFileName(std::string filename) ...@@ -301,16 +301,20 @@ std::string LLLogChat::cleanFileName(std::string filename)
std::string LLLogChat::timestamp2LogString(U32 timestamp, bool withdate) std::string LLLogChat::timestamp2LogString(U32 timestamp, bool withdate)
{ {
static const LLCachedControl<bool> show_timestamp_seconds(gSavedSettings, "ChatTimestampSeconds", false);
std::string timeStr; std::string timeStr;
if (withdate) if (withdate)
{ {
static const std::string timestamp_long_fmt = fmt::format(FMT_STRING("[{}]/[{}]/[{}] [{}]:[{}]"), LLTrans::getString("TimeYear"), LLTrans::getString("TimeMonth"), LLTrans::getString("TimeDay"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin")); static const std::string timestamp_long_fmt = fmt::format(FMT_STRING("[{}]/[{}]/[{}] [{}]:[{}]"), LLTrans::getString("TimeYear"), LLTrans::getString("TimeMonth"), LLTrans::getString("TimeDay"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
timeStr = timestamp_long_fmt; static const std::string timestamp_long_sec_fmt = fmt::format(FMT_STRING("[{}]/[{}]/[{}] [{}]:[{}]:[{}]"), LLTrans::getString("TimeYear"), LLTrans::getString("TimeMonth"), LLTrans::getString("TimeDay"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
timeStr = show_timestamp_seconds ? timestamp_long_sec_fmt : timestamp_long_fmt;
} }
else else
{ {
static const std::string timestamp_short_fmt = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin")); static const std::string timestamp_short_fmt = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
timeStr = timestamp_short_fmt; static const std::string timestamp_short_sec_fmt = fmt::format(FMT_STRING("[{}]:[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
timeStr = show_timestamp_seconds ? timestamp_short_sec_fmt : timestamp_short_fmt;
} }
LLSD substitution; LLSD substitution;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment