summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llfloaterperms.cpp34
-rwxr-xr-xindra/newview/llfloaterperms.h3
-rwxr-xr-xindra/newview/llviewerregion.cpp5
3 files changed, 26 insertions, 16 deletions
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index b03a4e9013..28fb76160a 100755
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -158,30 +158,42 @@ void LLFloaterPermsDefault::onCommitCopy(const LLSD& user_data)
class LLFloaterPermsResponder : public LLHTTPClient::Responder
{
public:
- LLFloaterPermsResponder(): LLHTTPClient::Responder() {}
+ LLFloaterPermsResponder(): LLHTTPClient::Responder() {}
+private:
+ std::string mPreviousReason;
void error(U32 status, const std::string& reason)
{
- LLSD args;
- args["REASON"] = reason;
- LLNotificationsUtil::add("DefaultObjectPermissions", args);
+llwarns << "DBG !" << mPreviousReason << "!" << llendl;
+ // Do not display the same error more than once in a row
+ if (reason != mPreviousReason)
+ {
+ mPreviousReason = reason;
+ LLSD args;
+ args["REASON"] = reason;
+ LLNotificationsUtil::add("DefaultObjectPermissions", args);
+ }
}
void result(const LLSD& content)
{
+ // Since we have had a successful POST call be sure to display the next error message
+ // even if it is the same as a previous one.
+ mPreviousReason = "";
LLFloaterPermsDefault::setCapSent(true);
LL_INFOS("FloaterPermsResponder") << "Sent default permissions to simulator" << LL_ENDL;
}
};
-void LLFloaterPermsDefault::updateCap(bool alwaysUpdate)
+void LLFloaterPermsDefault::sendInitialPerms()
{
-llwarns << "DBG start" << llendl;
- if(!alwaysUpdate && mCapSent)
+ if(!mCapSent)
{
- return;
+ updateCap();
}
+}
-llwarns << "DBG getRegion" << llendl;
+void LLFloaterPermsDefault::updateCap()
+{
std::string object_url = gAgent.getRegion()->getCapability("AgentPreferences");
if(!object_url.empty())
@@ -193,7 +205,7 @@ llwarns << "DBG getRegion" << llendl;
(LLSD::Integer)LLFloaterPerms::getEveryonePerms(sCategoryNames[CAT_OBJECTS]);
report["default_object_perm_masks"]["NextOwner"] =
(LLSD::Integer)LLFloaterPerms::getNextOwnerPerms(sCategoryNames[CAT_OBJECTS]);
-llwarns << "DBG post:" << report << llendl;
+
LLHTTPClient::post(object_url, report, new LLFloaterPermsResponder());
}
}
@@ -211,7 +223,7 @@ void LLFloaterPermsDefault::ok()
// We know some setting has changed but not which one. Just in case it was a setting for
// object permissions tell the server what the values are.
- updateCap(true);
+ updateCap();
}
void LLFloaterPermsDefault::cancel()
diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h
index b4b5d58aa5..2bb0a19dc1 100755
--- a/indra/newview/llfloaterperms.h
+++ b/indra/newview/llfloaterperms.h
@@ -59,7 +59,8 @@ public:
void onClickOK();
void onClickCancel();
void onCommitCopy(const LLSD& user_data);
- static void updateCap(bool alwaysUpdate);
+ static void sendInitialPerms();
+ static void updateCap();
static void setCapSent(bool cap_sent);
// Update instantiation of sCategoryNames in the .cpp file to match if you change this!
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 4cd9f9769a..dcecddece5 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1574,10 +1574,7 @@ void LLViewerRegion::unpackRegionHandshake()
msg->addU32("Flags", 0x0 );
msg->sendReliable(host);
- // Supplying false in this call means only send the default permissions to the simulator if
- // it has never been sent. Once this data is sent the simulator will pass this data to new
- // simulators as the agent moves around.
- LLFloaterPermsDefault::updateCap(false);
+ LLFloaterPermsDefault::sendInitialPerms();
}
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)