From 0e75fe80cd226f44f0008cc25b8e5b31787f0ebc Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sun, 9 Oct 2011 12:20:50 -0400 Subject: [PATCH] FIRE-3280, Accept inventory when autoaccept option is true, by Nicky Dasmijn --- indra/newview/llviewermessage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9523a75e7c..9e65953f02 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1985,6 +1985,8 @@ void inventory_offer_handler(LLOfferInfo* info) return; } + + bool bAutoAccept(false); // Avoid the Accept/Discard dialog if the user so desires. JC if (gSavedSettings.getBOOL("AutoAcceptNewInventory") && (info->mType == LLAssetType::AT_NOTECARD @@ -1993,8 +1995,7 @@ void inventory_offer_handler(LLOfferInfo* info) { // For certain types, just accept the items into the inventory, // and possibly open them on receipt depending upon "ShowNewInventory". - info->forceResponse(IOR_ACCEPT); - return; + bAutoAccept = true; } // Strip any SLURL from the message display. (DEV-2754) @@ -2065,7 +2066,7 @@ void inventory_offer_handler(LLOfferInfo* info) LLNotification::Params p("ObjectGiveItem"); // Object -> Agent Inventory Offer - if (info->mFromObject) + if (info->mFromObject && !bAutoAccept ) // Nicky D. fall into the Avi->Avi branch for auto accepting items. { // [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a // Only filter if the object owner is a nearby agent @@ -2122,6 +2123,7 @@ void inventory_offer_handler(LLOfferInfo* info) // In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages). info->send_auto_receive_response(); + if( !bAutoAccept ) // Nicky D. if we auto accept, do not pester the user with stuff in the chicklet. // Inform user that there is a script floater via toast system { payload["give_inventory_notification"] = TRUE;