diff options
author | Jonathan Yap <none@none> | 2013-11-11 13:21:12 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-11-11 13:21:12 -0500 |
commit | 56b1b35a18c21f6dad4147df35ba4594f31b67e3 (patch) | |
tree | 76782fe8d40225bf9a31a631f6471c18091b4220 /indra | |
parent | e988fffbca2199156ed656a091409394246f929d (diff) |
STORM-68 Send default permissions to simulator just once after logging in
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterperms.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llfloaterperms.h | 3 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 5 |
3 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index c167c03c30..f5a9bc7bb5 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -97,6 +97,8 @@ U32 LLFloaterPerms::getNextOwnerPermsInverted(std::string prefix) return flags; } +static bool mCapSent = false; + LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed) : LLFloater(seed) { @@ -160,12 +162,18 @@ public: } void result(const LLSD& content) { - LL_INFOS("FloaterPermsResponder") << "Set new values" << LL_ENDL; + LLFloaterPermsDefault::setCapSent(true); + LL_INFOS("FloaterPermsResponder") << "Sent default permissions to simulator" << LL_ENDL; } }; -void LLFloaterPermsDefault::updateCap() +void LLFloaterPermsDefault::updateCap(bool alwaysUpdate) { + if(!alwaysUpdate && mCapSent) + { + return; + } + std::string object_url = gAgent.getRegion()->getCapability("DefaultObjectPermissions"); if(!object_url.empty()) @@ -178,6 +186,11 @@ void LLFloaterPermsDefault::updateCap() } } +void LLFloaterPermsDefault::setCapSent(bool cap_sent) +{ + mCapSent = cap_sent; +} + void LLFloaterPermsDefault::ok() { // Changes were already applied automatically to saved settings. @@ -186,7 +199,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(); + updateCap(true); } void LLFloaterPermsDefault::cancel() diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index 5fe39a2c1b..a31d034ec8 100644 --- 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(); + static void updateCap(bool alwaysUpdate); + static void setCapSent(bool cap_sent); enum Categories { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7b5721cb39..68db98580f 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1487,7 +1487,10 @@ void LLViewerRegion::unpackRegionHandshake() msg->addU32("Flags", 0x0 ); msg->sendReliable(host); - LLFloaterPermsDefault::updateCap(); + // 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); } void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) |