summaryrefslogtreecommitdiff
path: root/indra/newview/lllogininstance.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2017-08-14 07:15:18 -0400
committerOz Linden <oz@lindenlab.com>2017-08-14 07:15:18 -0400
commit612ff7b6b3f3abb56ff6bf8331e2a1cd04c04066 (patch)
tree8ac7debd75b1cad835c399d641aa3eff22046edf /indra/newview/lllogininstance.cpp
parent87a582a02c439149b24f2554fb416aa5dedda0e2 (diff)
MAINT-7640: Notify the user if login is blocked for a required viewer update
Diffstat (limited to 'indra/newview/lllogininstance.cpp')
-rw-r--r--indra/newview/lllogininstance.cpp41
1 files changed, 34 insertions, 7 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 229703bb39..b953534e13 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -31,6 +31,7 @@
// llcommon
#include "llevents.h"
#include "stringize.h"
+#include "llsdserialize.h"
// llmessage (!)
#include "llfiltersd2xmlrpc.h" // for xml_escape_string()
@@ -47,12 +48,10 @@
#include "llstartup.h"
#include "llfloaterreg.h"
#include "llnotifications.h"
+#include "llnotificationsutil.h"
#include "llwindow.h"
#include "llviewerwindow.h"
#include "llprogressview.h"
-#if LL_LINUX
-#include "lltrans.h"
-#endif
#include "llsecapi.h"
#include "llstartup.h"
#include "llmachineid.h"
@@ -250,8 +249,6 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event)
void LLLoginInstance::handleLoginFailure(const LLSD& event)
{
-
-
// Login has failed.
// Figure out why and respond...
LLSD response = event["data"];
@@ -302,13 +299,42 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
boost::bind(&LLLoginInstance::handleTOSResponse,
this, _1, "read_critical"));
}
+ else if(reason_response == "update")
+ {
+ // This shouldn't happen - the viewer manager should have forced an update;
+ // possibly the user ran the viewer directly and bypassed the update check
+ std::string required_version = response["message_args"]["VERSION"];
+ LL_WARNS() << "Login failed because an update to version " << required_version << " is required." << LL_ENDL;
+
+ if (gViewerWindow)
+ gViewerWindow->setShowProgress(FALSE);
+
+ LLSD data(LLSD::emptyMap());
+ data["VERSION"] = required_version;
+ LLNotificationsUtil::add("RequiredUpdate", data, LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2));
+ }
+ else if(reason_response == "key")
+ {
+ // this is a password problem or other restriction
+ // an appropriate message has already been displayed
+ attemptComplete();
+ }
else
{
- LL_INFOS() << "LLLoginInstance::handleLoginFailure attemptComplete" << LL_ENDL;
- attemptComplete();
+ LL_WARNS() << "Login failed for an unknown reason: " << LLSDOStreamer<LLSDNotationFormatter>(response) << LL_ENDL;
+
+ if (gViewerWindow)
+ gViewerWindow->setShowProgress(FALSE);
+
+ LLNotificationsUtil::add("LoginFailedUnknown", LLSD::emptyMap(), LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2));
}
}
+void LLLoginInstance::handleLoginDisallowed(const LLSD& notification, const LLSD& response)
+{
+ attemptComplete();
+}
+
void LLLoginInstance::handleLoginSuccess(const LLSD& event)
{
LL_INFOS() << "LLLoginInstance::handleLoginSuccess" << LL_ENDL;
@@ -363,6 +389,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
return true;
}
+
std::string construct_start_string()
{
std::string start;