summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-05-24 14:28:25 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-05-24 14:28:25 -0700
commitd6f7526abf223b671b4e17be48dcc1e46e8f2fd8 (patch)
tree9ac72b9bfb546e3542442eeff72af78c75f3ca67 /indra/newview/llstartup.cpp
parent0a86e39d90e06f0a690b1ff5caf2dee5fe347f8f (diff)
parente5752934be74a84e6ec0ff8cb96974bd1e9060ec (diff)
Merge
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 534540ee31..86b09473ab 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -995,6 +995,7 @@ bool idle_startup()
if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState())
{
+ // Generic failure message
std::ostringstream emsg;
emsg << LLTrans::getString("LoginFailed") << "\n";
if(LLLoginInstance::getInstance()->authFailure())
@@ -1003,24 +1004,32 @@ bool idle_startup()
<< LLLoginInstance::getInstance()->getResponse() << LL_ENDL;
LLSD response = LLLoginInstance::getInstance()->getResponse();
// Still have error conditions that may need some
- // sort of handling.
+ // sort of handling - dig up specific message
std::string reason_response = response["reason"];
std::string message_response = response["message"];
-
- if(!message_response.empty())
+ 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"]))
{
- // XUI: fix translation for strings returned during login
- // We need a generic table for translations
- std::string big_reason = LLAgent::sTeleportErrorMessages[ message_response ];
- if ( big_reason.size() == 0 )
- {
- emsg << message_response;
- }
- else
- {
- emsg << big_reason;
- }
+ // message will be filled in with the template and arguments
}
+ else if(!message_response.empty())
+ {
+ // *HACK: "no_inventory_host" sent as the message itself.
+ // Remove this clause when server is sending message_id as well.
+ message = LLAgent::sTeleportErrorMessages[ message_response ];
+ }
+
+ if (message.empty())
+ {
+ // Fallback to server-supplied string; necessary since server
+ // may add strings that this viewer is not yet aware of
+ message = message_response;
+ }
+
+ emsg << message;
+
if(reason_response == "key")
{