summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-06-29 20:31:17 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-06-29 20:31:17 +0300
commit77ce594dec86eacadb39abf56c69d03b6f421a59 (patch)
tree206d5ffc8e7e275929d3dbbe0ef4fd098c8d7ca0 /indra/newview/llstartup.cpp
parent192e7284aa7275f1b4e37bfd639bf317182bb5e2 (diff)
parent1e4f2ec07e32a142f35817d3186a124df3f8cd25 (diff)
Merge branch 'master' into DRTVWR-544-maint
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index b32cff31d0..9abe8b0bab 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1069,7 +1069,7 @@ bool idle_startup()
{
// Generic failure message
std::ostringstream emsg;
- emsg << LLTrans::getString("LoginFailed") << "\n";
+ emsg << LLTrans::getString("LoginFailedHeader") << "\n";
if(LLLoginInstance::getInstance()->authFailure())
{
LL_INFOS("LLStartup") << "Login failed, LLLoginInstance::getResponse(): "
@@ -1082,11 +1082,37 @@ bool idle_startup()
std::string message_id = response["message_id"];
std::string message; // actual string to show the user
- if(!message_id.empty() && LLTrans::findString(message, message_id, response["message_args"]))
- {
- // message will be filled in with the template and arguments
- }
- else if(!message_response.empty())
+ bool localized_by_id = false;
+ if(!message_id.empty())
+ {
+ LLSD message_args = response["message_args"];
+ if (message_args.has("TIME")
+ && (message_id == "LoginFailedAcountSuspended"
+ || message_id == "LoginFailedAccountMaintenance"))
+ {
+ LLDate date;
+ std::string time_string;
+ if (date.fromString(message_args["TIME"].asString()))
+ {
+ LLSD args;
+ args["datetime"] = (S32)date.secondsSinceEpoch();
+ LLTrans::findString(time_string, "LocalTime", args);
+ }
+ else
+ {
+ time_string = message_args["TIME"].asString() + " " + LLTrans::getString("PacificTime");
+ }
+
+ message_args["TIME"] = time_string;
+ }
+ // message will be filled in with the template and arguments
+ if (LLTrans::findString(message, message_id, message_args))
+ {
+ localized_by_id = true;
+ }
+ }
+
+ if(!localized_by_id && !message_response.empty())
{
// *HACK: "no_inventory_host" sent as the message itself.
// Remove this clause when server is sending message_id as well.