summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-07-26 14:44:04 -0700
committerMerov Linden <merov@lindenlab.com>2014-07-26 14:44:04 -0700
commit51e4ad0ed0ba07328ec8415742a3f5c60afc7244 (patch)
tree75c72f396c43e9f4314f1284ee3de56bef2098f8 /indra/newview/llinventorybridge.cpp
parentbd5da258ea4cd5557bc79f29b0034cf666d0f652 (diff)
DD-101 : Do not list or associate listings that do not validate. Present user with relevant error when that happens.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-xindra/newview/llinventorybridge.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index ba5374e437..5c5ad1fa30 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2975,7 +2975,15 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
}
else if ("marketplace_list" == action)
{
- if (depth_nesting_in_marketplace(mUUID) == 1)
+ LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID);
+ mMessage = "";
+ if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2)))
+ {
+ LLSD subs;
+ subs["[ERROR_CODE]"] = mMessage;
+ LLNotificationsUtil::add("MerchantListingFailed", subs);
+ }
+ else if (depth_nesting_in_marketplace(mUUID) == 1)
{
LLMarketplaceData::instance().activateListing(mUUID,true);
}
@@ -3025,7 +3033,18 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
}
else if ("marketplace_associate_listing" == action)
{
- LLFloaterAssociateListing::show(mUUID);
+ LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID);
+ mMessage = "";
+ if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2)))
+ {
+ LLSD subs;
+ subs["[ERROR_CODE]"] = mMessage;
+ LLNotificationsUtil::add("MerchantListingFailed", subs);
+ }
+ else
+ {
+ LLFloaterAssociateListing::show(mUUID);
+ }
return;
}
else if ("marketplace_edit_listing" == action)
@@ -3055,6 +3074,18 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
}
}
+void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_level)
+{
+ if (log_level >= LLError::LEVEL_ERROR)
+ {
+ if (!mMessage.empty())
+ {
+ mMessage += "\n";
+ }
+ mMessage += message;
+ }
+}
+
void LLFolderBridge::openItem()
{
LL_DEBUGS() << "LLFolderBridge::openItem()" << LL_ENDL;