summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-17 22:14:26 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-17 22:14:26 +0300
commit9373f64f49ad9d0676731041466d353274ee51bd (patch)
tree90eea11c7b8403e991811cca07a0579b6d24c6e6 /indra/newview/llchathistory.cpp
parentd2e242ab632a051e0b357efa1fdd0a1a64027f44 (diff)
SL-3007 Small improvements for auto filling abuse reports
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index f286e4c075..5edc8a1291 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -406,8 +406,30 @@ public:
}
else if (level == "report_abuse")
{
- std::string time = getChild<LLTextBox>("time_box")->getValue().asString();
- LLFloaterReporter::showFromChat(mAvatarID, mFrom, time, mText);
+ std::string time_string;
+ if (mTime > 0) // have frame time
+ {
+ time_t current_time = time_corrected();
+ time_t message_time = current_time - LLFrameTimer::getElapsedSeconds() + mTime;
+
+ time_string = "[" + LLTrans::getString("TimeMonth") + "]/["
+ + LLTrans::getString("TimeDay") + "]/["
+ + LLTrans::getString("TimeYear") + "] ["
+ + LLTrans::getString("TimeHour") + "]:["
+ + LLTrans::getString("TimeMin") + "]";
+
+ LLSD substitution;
+
+ substitution["datetime"] = (S32)message_time;
+ LLStringUtil::format(time_string, substitution);
+ }
+ else
+ {
+ // From history. This might be not full.
+ // See LLChatLogParser::parse if it needs to include full date
+ time_string = getChild<LLTextBox>("time_box")->getValue().asString();
+ }
+ LLFloaterReporter::showFromChat(mAvatarID, mFrom, time_string, mText);
}
else if(level == "block_unblock")
{
@@ -642,6 +664,7 @@ public:
// and it's easier to store text directly than trying to get
// it from a lltextsegment or chat's mEditor
mText = chat.mText;
+ mTime = chat.mTime;
//*TODO overly defensive thing, source type should be maintained out there
if((chat.mFromID.isNull() && chat.mFromName.empty()) || (chat.mFromName == SYSTEM_FROM && chat.mFromID.isNull()))
@@ -993,6 +1016,7 @@ protected:
std::string mFrom;
LLUUID mSessionID;
std::string mText;
+ F64 mTime;
S32 mMinUserNameWidth;
const LLFontGL* mUserNameFont;