summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 51bbc9fb90..42c73d5668 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -2007,26 +2007,37 @@ void LLFloaterEditExtDayCycle::onAssetLoadedForInsertion(LLUUID item_id, LLUUID
LLInventoryItem *inv_item = gInventory.getItem(item_id);
- if (inv_item
- && mInventoryItem
- && mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())
- && !inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
+ if (inv_item && !inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
{
- LLSD args;
+ // Need to check if item is already no-transfer, otherwise make it no-transfer
+ bool no_transfer = false;
+ if (mInventoryItem)
+ {
+ no_transfer = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+ }
+ else
+ {
+ no_transfer = mEditDay->getFlag(LLSettingsBase::FLAG_NOTRANS);
+ }
- // create and show confirmation textbox
- LLNotificationsUtil::add("SettingsMakeNoTrans", args, LLSD(),
- [this, cb](const LLSD&notif, const LLSD&resp)
+ if (!no_transfer)
{
- S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
- if (opt == 0)
+ LLSD args;
+
+ // create and show confirmation textbox
+ LLNotificationsUtil::add("SettingsMakeNoTrans", args, LLSD(),
+ [this, cb](const LLSD&notif, const LLSD&resp)
{
- mMakeNoTrans = true;
- mEditDay->setFlag(LLSettingsBase::FLAG_NOTRANS);
- cb();
- }
- });
- return;
+ S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+ if (opt == 0)
+ {
+ mMakeNoTrans = true;
+ mEditDay->setFlag(LLSettingsBase::FLAG_NOTRANS);
+ cb();
+ }
+ });
+ return;
+ }
}
cb();