From 738106a6b1dea2859f6793ff8f4f429dc45497e4 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 22 Mar 2016 09:53:54 +0100 Subject: [PATCH 1/6] Dump "login_refresh" SLURL app command and implement missing "location_login" command instead --- indra/newview/fspanellogin.cpp | 84 ++++++++++++++++++++++++++++++++-- indra/newview/fspanellogin.h | 1 + 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 11e9477fe2..6dc2eb0d12 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -91,20 +91,86 @@ std::string FSPanelLogin::sPassword = ""; // For new accounts without a last name "Resident" is added as a last name. static std::string canonicalize_username(const std::string& name); -class LLLoginRefreshHandler : public LLCommandHandler +class LLLoginLocationAutoHandler : public LLCommandHandler { public: // don't allow from external browsers - LLLoginRefreshHandler() : LLCommandHandler("login_refresh", UNTRUSTED_BLOCK) { } + LLLoginLocationAutoHandler() : LLCommandHandler("location_login", UNTRUSTED_BLOCK) { } bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) { - FSPanelLogin::loadLoginPage(); + if ( tokens.size() == 0 || tokens.size() > 4 ) + return false; + + // unescape is important - uris with spaces are escaped in this code path + // (e.g. space -> %20) and the code to log into a region doesn't support that. + const std::string region = LLURI::unescape( tokens[0].asString() ); + + // just region name as payload + if ( tokens.size() == 1 ) + { + // region name only - slurl will end up as center of region + LLSLURL slurl(region); + FSPanelLogin::autologinToLocation(slurl); + } + else + // region name and x coord as payload + if ( tokens.size() == 2 ) + { + // invalid to only specify region and x coordinate + // slurl code will revert to same as region only, so do this anyway + LLSLURL slurl(region); + FSPanelLogin::autologinToLocation(slurl); + } + else + // region name and x/y coord as payload + if ( tokens.size() == 3 ) + { + // region and x/y specified - default z to 0 + F32 xpos; + std::istringstream codec(tokens[1].asString()); + codec >> xpos; + + F32 ypos; + codec.clear(); + codec.str(tokens[2].asString()); + codec >> ypos; + + const LLVector3 location(xpos, ypos, 0.0f); + LLSLURL slurl(region, location); + + FSPanelLogin::autologinToLocation(slurl); + } + else + // region name and x/y/z coord as payload + if ( tokens.size() == 4 ) + { + // region and x/y/z specified - ok + F32 xpos; + std::istringstream codec(tokens[1].asString()); + codec >> xpos; + + F32 ypos; + codec.clear(); + codec.str(tokens[2].asString()); + codec >> ypos; + + F32 zpos; + codec.clear(); + codec.str(tokens[3].asString()); + codec >> zpos; + + const LLVector3 location(xpos, ypos, zpos); + LLSLURL slurl(region, location); + + FSPanelLogin::autologinToLocation(slurl); + }; } return true; } }; +LLLoginLocationAutoHandler gLoginLocationAutoHandler; //--------------------------------------------------------------------------- // Public methods @@ -752,6 +818,18 @@ void FSPanelLogin::setLocation(const LLSLURL& slurl) LLStartUp::setStartSLURL(slurl); // calls onUpdateStartSLURL, above } +void FSPanelLogin::autologinToLocation(const LLSLURL& slurl) +{ + LL_DEBUGS("AppInit")<<"automatically logging into Location "<onClickConnect(unused_parameter); + } +} + // static void FSPanelLogin::closePanel() { diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h index b0ef3d6014..420b56f5ff 100644 --- a/indra/newview/fspanellogin.h +++ b/indra/newview/fspanellogin.h @@ -69,6 +69,7 @@ public: static BOOL areCredentialFieldsDirty(); static void setLocation(const LLSLURL& slurl); + static void autologinToLocation(const LLSLURL& slurl); /// Call when preferences that control visibility may have changed static void updateLocationSelectorsVisibility(); From 86db2b4f1ea05bdc0b39c23a05b7d664ae7fb495 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 23 Mar 2016 16:44:05 +0100 Subject: [PATCH 2/6] FIRE-17995: Urls without protocol randomly get broken Replace LLViewerTextEditor with the basic LLTextEditor because LLViewerTextEditor will parse the text again after it's being added and replace URLs with their label, assuming the user is going to edit the text - which is not the case here. --- indra/newview/lltoastgroupnotifypanel.cpp | 5 ++++- indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml | 4 ---- indra/newview/skins/ansastorm/xui/en/panel_group_notify.xml | 4 ++-- indra/newview/skins/default/xui/de/panel_group_notify.xml | 4 ---- indra/newview/skins/default/xui/en/panel_group_notify.xml | 4 ++-- indra/newview/skins/default/xui/es/panel_group_notify.xml | 1 - indra/newview/skins/default/xui/ja/panel_group_notify.xml | 3 --- indra/newview/skins/default/xui/tr/panel_group_notify.xml | 3 --- indra/newview/skins/default/xui/zh/panel_group_notify.xml | 3 --- indra/newview/skins/firestorm/xui/de/panel_group_notify.xml | 4 ---- indra/newview/skins/firestorm/xui/en/panel_group_notify.xml | 4 ++-- indra/newview/skins/firestorm/xui/es/panel_group_notify.xml | 1 - indra/newview/skins/latency/xui/en/panel_group_notify.xml | 2 +- indra/newview/skins/metaharper/xui/en/panel_group_notify.xml | 4 ++-- indra/newview/skins/metaharper/xui/es/panel_group_notify.xml | 1 - indra/newview/skins/starlight/xui/en/panel_group_notify.xml | 4 ++-- .../newview/skins/starlightcui/xui/en/panel_group_notify.xml | 4 ++-- indra/newview/skins/vintage/xui/en/panel_group_notify.xml | 2 +- indra/newview/skins/vintage/xui/es/panel_group_notify.xml | 1 - indra/newview/skins/vintage/xui/ja/panel_group_notify.xml | 1 - 20 files changed, 18 insertions(+), 41 deletions(-) diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index c6c15adb41..c8ec76b6f1 100755 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -113,7 +113,10 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(const LLNotificationPtr& notifi substitution["datetime"] = (S32) notice_date.secondsSinceEpoch(); LLStringUtil::format(timeStr, substitution); - LLViewerTextEditor* pMessageText = getChild("message"); + // FIRE-17995: Urls without protocol randomly get broken + //LLViewerTextEditor* pMessageText = getChild("message"); + LLTextEditor* pMessageText = getChild("message"); + // pMessageText->setContentTrusted(false); pMessageText->clear(); diff --git a/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml b/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml index f426b88605..c95d11eb3a 100644 --- a/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml +++ b/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml @@ -1,12 +1,8 @@ - - - -