summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-12-14 15:48:46 -0800
committerMerov Linden <merov@lindenlab.com>2014-12-14 15:48:46 -0800
commit00f3850fe2e2527f7f0f663f94cdabc83949b946 (patch)
treecd6b9d713d8f984e4a5c44dcd7c6380c7d6b3764 /indra
parent9fb9b087ff5ec8ca981bfd1c8e94d114d4068b58 (diff)
DD-299 : Suppress cap hardcoded fallback. Recheck cap after each teleport.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llagent.cpp6
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp19
-rwxr-xr-xindra/newview/llmarketplacefunctions.h2
-rwxr-xr-xindra/newview/llstartup.cpp7
-rwxr-xr-xindra/newview/llviewermenu.cpp21
5 files changed, 32 insertions, 23 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e5a90e8a28..392fe8fc2e 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3867,6 +3867,12 @@ void LLAgent::handleTeleportFinished()
LLNotificationsUtil::add("PreferredMaturityChanged", args);
mIsMaturityRatingChangingDuringTeleport = false;
}
+
+ // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant
+ // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no reason to show the old UI at all.
+ // Note: Some regions will not support the SLM cap for a while so we need to do that check for each teleport.
+ // *TODO : Suppress that line from here once the whole grid migrated to SLM and move it to idle_startup() (llstartup.cpp)
+ check_merchant_status();
}
void LLAgent::handleTeleportFailed()
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index d900d29925..c35b251c7e 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1178,10 +1178,13 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type&
else
{
// Initiate SLM connection and set responder
- mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING;
std::string url = getSLMConnectURL("/merchant");
- log_SLM_infos("LLHTTPClient::get", url, "");
- LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD());
+ if (url != "")
+ {
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING;
+ log_SLM_infos("LLHTTPClient::get", url, "");
+ LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD());
+ }
}
}
@@ -1325,16 +1328,10 @@ std::string LLMarketplaceData::getSLMConnectURL(const std::string& route)
{
// Get DirectDelivery cap
url = regionp->getCapability("DirectDelivery");
- // *TODO : Take this DirectDelivery cap coping mechanism hack out
- if (url == "")
- {
- url = "https://marketplace.secondlife-staging.com/api/1/viewer/" + gAgentID.asString();
- }
- else
+ if (url != "")
{
- llinfos << "Merov : DD cap = " << url << ", agent = " << gAgentID.asString() << llendl;
+ url += route;
}
- url += route;
}
return url;
}
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index 391ab8a733..4aca88cba1 100755
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -187,6 +187,7 @@ public:
typedef boost::signals2::signal<void ()> status_updated_signal_t;
void initializeSLM(const status_updated_signal_t::slot_type& cb);
U32 getSLMStatus() const { return mMarketPlaceStatus; }
+ void setSLMStatus(U32 status);
void getSLMListings();
bool isEmpty() { return (mMarketplaceItems.size() == 0); }
@@ -234,7 +235,6 @@ private:
bool setCountOnHand(const LLUUID& folder_id, S32 count, bool update = true);
// Private SLM API : package data and get/post/put requests to the SLM Server through the SLM API
- void setSLMStatus(U32 status);
void createSLMListing(const LLUUID& folder_id);
void getSLMListing(S32 listing_id);
void updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, S32 count);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index fa8a6eb87a..cfc654eb98 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1876,11 +1876,8 @@ bool idle_startup()
display_startup();
- // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant
- // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no
- // reason to show the old UI at all.
- // *TODO : Suppress the Merchant Outbox UI completely
- check_merchant_status();
+ // *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp)
+ //check_merchant_status();
display_startup();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2fb1713062..1de615aa6e 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -422,8 +422,10 @@ void check_merchant_status()
{
if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth"))
{
- // Hide both merchant related menu items
- gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE);
+ // Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status()
+ LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED);
+
+ // Hide SLM related menu item
gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE);
// Also disable the toolbar button for Marketplace Listings
@@ -432,10 +434,17 @@ void check_merchant_status()
// Launch an SLM test connection to get the merchant status
LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu));
-
- // Launch a Merchant Outbox test connection to get the migration status
- LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2));
- LLMarketplaceInventoryImporter::instance().initialize();
+
+ // Do the Merchant Outbox init only once per session
+ if (LLMarketplaceInventoryImporter::instance().getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED)
+ {
+ // Hide merchant outbox related menu item
+ gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE);
+
+ // Launch a Merchant Outbox test connection to get the migration status
+ LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2));
+ LLMarketplaceInventoryImporter::instance().initialize();
+ }
}
}