From 69dadde429f19ad155d0bbcf40a63a2a02f94f91 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 8 Jan 2019 18:45:42 +0100 Subject: [PATCH] FIRE-23476: Don't select inventory offer in inventory under AutoAcceptNewInventory && !ShowInInventory && ShowNewInventory condition --- indra/newview/llimprocessing.cpp | 2 +- indra/newview/llviewermessage.cpp | 9 ++++++--- indra/newview/llviewermessage.h | 13 ++++++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 48d89d807b..371c7fd44e 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -438,7 +438,7 @@ void inventory_offer_handler(LLOfferInfo* info) itemp = (LLViewerInventoryItem*)gInventory.getItem(info->mObjectID); } - LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(info->mObjectID, info->mFromName); + LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(info->mObjectID, info->mFromName, false); open_agent_offer->startFetch(); if(catp || (itemp && itemp->isFinished())) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1ce3e1d0b0..469f016936 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1539,7 +1539,7 @@ bool check_asset_previewable(const LLAssetType::EType asset_type) // FIRE-15886 //void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name) -void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name, bool from_agent /* = false*/) +void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name, bool from_agent_manual /* = false*/) { for (uuid_vec_t::const_iterator obj_iter = objects.begin(); obj_iter != objects.end(); @@ -1659,7 +1659,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam // Highlight item // Only show if either ShowInInventory is true OR it is an inventory // offer from an agent and the asset is not previewable - const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") || (from_agent && !check_asset_previewable(asset_type)); + const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") || (from_agent_manual && !check_asset_previewable(asset_type)); //gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false //!from_name.empty(); // don't open if it's not from anyone. // Don't mess with open inventory panels when ShowInInventory is FALSE @@ -1973,7 +1973,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // ShowNewInventory that is actually changable by the user! //if (gSavedSettings.getBOOL("ShowOfferedInventory")) { - LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string); + // FIRE-23476: Don't select inventory offer in inventory if AutoAcceptNewInventory && !ShowInInventory && ShowNewInventory + //LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string); + LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string, true); + // open_agent_offer->startFetch(); if(catp || (itemp && itemp->isFinished())) { diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index a4a0546511..b5fc93ca29 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -223,7 +223,7 @@ void process_initiate_download(LLMessageSystem* msg, void**); void start_new_inventory_observer(); // FIRE-15886 //void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name); -void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name, bool from_agent = false); +void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name, bool from_agent_manual = false); // Returns true if item is not in certain "quiet" folder which don't need UI // notification (e.g. trash, cof, lost-and-found) and agent is not AFK, false otherwise. @@ -297,9 +297,11 @@ class LLOpenAgentOffer : public LLInventoryFetchItemsObserver { public: LLOpenAgentOffer(const LLUUID& object_id, - const std::string& from_name) : + const std::string& from_name, + bool is_manuelly_accepted) : LLInventoryFetchItemsObserver(object_id), - mFromName(from_name) {} + mFromName(from_name), + mIsManuallyAccepted(is_manuelly_accepted) {} /*virtual*/ void startFetch() { for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) @@ -318,12 +320,13 @@ public: // This only gets called if the user explicity clicks "Show" or // AutoAcceptNewInventory and ShowNewInventory are TRUE. //open_inventory_offer(mComplete, mFromName); - open_inventory_offer(mComplete, mFromName, true); + open_inventory_offer(mComplete, mFromName, mIsManuallyAccepted); gInventory.removeObserver(this); delete this; } private: - std::string mFromName; + std::string mFromName; + bool mIsManuallyAccepted; }; //