From 24ed25883df8e0b7b102dc4cfc997b1c8445c4d4 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 8 Jan 2015 22:58:19 +0100 Subject: [PATCH] More hacking on the group notice attachments - Who at LL had the idea to route IOR_ACCEPT through IOR_SHOW??? --- indra/newview/llviewermessage.cpp | 29 +++++++++++-------- .../skins/default/xui/en/notifications.xml | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e7d9127584..ed2a0c65e0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1785,13 +1785,21 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } // FIRE-3832: Silent accept/decline of inventory offers - if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_ACCEPT) + if (mIM == IM_GROUP_NOTICE) { + opener = new LLOpenTaskGroupOffer; send_auto_receive_response(); } - if (gSavedSettings.getBOOL("ShowInInventory")) + else { - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mObjectID); + if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_ACCEPT) + { + send_auto_receive_response(); + } + if (gSavedSettings.getBOOL("ShowInInventory")) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mObjectID); + } } // @@ -1834,7 +1842,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } // Optional V1-like inventory accept messages - if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_DECLINE) + if ((gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_DECLINE) && mIM == IM_INVENTORY_OFFERED) { send_decline_response(); } @@ -9318,10 +9326,7 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response) // Now this is a hell of piece of... forceResponse() will look for the // ELEMENT index, and NOT the button index. So if we want to force a // response of IOR_ACCEPT, we need to pass the correct element - // index of the button. Since we have modified the button order and also - // added legacy accept/decline messages support, we want to reponse with - // the silent version. So we don't use UserGiveItem but UserGiveItemLegacy - // and map the button index to the correct element index. + // index of the button. //LLNotification::Params params("UserGiveItem"); //params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); //LLNotifications::instance().forceResponse(params, response); @@ -9329,19 +9334,19 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response) switch (response) { case IOR_ACCEPT: - element_index = 4; + element_index = 1; break; case IOR_DECLINE: - element_index = 5; + element_index = 2; break; case IOR_MUTE: - element_index = 6; + element_index = 3; break; default: element_index = -1; break; } - LLNotification::Params params("UserGiveItemLegacy"); + LLNotification::Params params("UserGiveItem"); params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); LLNotifications::instance().forceResponse(params, element_index); // diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 63039ef1ec..62eb14b29d 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7180,6 +7180,7 @@ Your object named <nolink>[OBJECTFROMNAME]</nolink> has given you th + -