More hacking on the group notice attachments - Who at LL had the idea to route IOR_ACCEPT through IOR_SHOW???

Thu, 08 Jan 2015 22:58:19 +0100

author
Ansariel
date
Thu, 08 Jan 2015 22:58:19 +0100
changeset 43113
914e99317e51
parent 43112
d553b6945f37
child 43114
319c7155cdec

More hacking on the group notice attachments - Who at LL had the idea to route IOR_ACCEPT through IOR_SHOW???

indra/newview/llviewermessage.cpp file | annotate | diff | revisions
indra/newview/skins/default/xui/en/notifications.xml file | annotate | diff | revisions
     1.1 --- a/indra/newview/llviewermessage.cpp	Thu Jan 08 22:10:02 2015 +0100
     1.2 +++ b/indra/newview/llviewermessage.cpp	Thu Jan 08 22:58:19 2015 +0100
     1.3 @@ -1785,13 +1785,21 @@
     1.4  		}
     1.5  
     1.6  		// <FS:Ansariel> FIRE-3832: Silent accept/decline of inventory offers
     1.7 -		if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_ACCEPT)
     1.8 -		{
     1.9 +		if (mIM == IM_GROUP_NOTICE)
    1.10 +		{
    1.11 +			opener = new LLOpenTaskGroupOffer;
    1.12  			send_auto_receive_response();
    1.13  		}
    1.14 -		if (gSavedSettings.getBOOL("ShowInInventory"))
    1.15 -		{
    1.16 -			LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mObjectID);
    1.17 +		else
    1.18 +		{
    1.19 +			if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_ACCEPT)
    1.20 +			{
    1.21 +				send_auto_receive_response();
    1.22 +			}
    1.23 +			if (gSavedSettings.getBOOL("ShowInInventory"))
    1.24 +			{
    1.25 +				LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mObjectID);
    1.26 +			}
    1.27  		}
    1.28  		// </FS:Ansariel>
    1.29  
    1.30 @@ -1834,7 +1842,7 @@
    1.31  			}
    1.32  
    1.33  			// <FS:Ansariel> Optional V1-like inventory accept messages
    1.34 -			if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_DECLINE)
    1.35 +			if ((gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages") && button == IOR_DECLINE) && mIM == IM_INVENTORY_OFFERED)
    1.36  			{
    1.37  				send_decline_response();
    1.38  			}
    1.39 @@ -9318,10 +9326,7 @@
    1.40  	// <FS:Ansariel> Now this is a hell of piece of... forceResponse() will look for the
    1.41  	//               ELEMENT index, and NOT the button index. So if we want to force a
    1.42  	//               response of IOR_ACCEPT, we need to pass the correct element
    1.43 -	//               index of the button. Since we have modified the button order and also
    1.44 -	//               added legacy accept/decline messages support, we want to reponse with
    1.45 -	//               the silent version. So we don't use UserGiveItem but UserGiveItemLegacy
    1.46 -	//               and map the button index to the correct element index.
    1.47 +	//               index of the button.
    1.48  	//LLNotification::Params params("UserGiveItem");
    1.49  	//params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2));
    1.50  	//LLNotifications::instance().forceResponse(params, response);
    1.51 @@ -9329,19 +9334,19 @@
    1.52  	switch (response)
    1.53  	{
    1.54  		case IOR_ACCEPT:
    1.55 -			element_index = 4;
    1.56 +			element_index = 1;
    1.57  			break;
    1.58  		case IOR_DECLINE:
    1.59 -			element_index = 5;
    1.60 +			element_index = 2;
    1.61  			break;
    1.62  		case IOR_MUTE:
    1.63 -			element_index = 6;
    1.64 +			element_index = 3;
    1.65  			break;
    1.66  		default:
    1.67  			element_index = -1;
    1.68  			break;
    1.69  	}
    1.70 -	LLNotification::Params params("UserGiveItemLegacy");
    1.71 +	LLNotification::Params params("UserGiveItem");
    1.72  	params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2));
    1.73  	LLNotifications::instance().forceResponse(params, element_index);
    1.74  	// </FS:Ansariel>
     2.1 --- a/indra/newview/skins/default/xui/en/notifications.xml	Thu Jan 08 22:10:02 2015 +0100
     2.2 +++ b/indra/newview/skins/default/xui/en/notifications.xml	Thu Jan 08 22:58:19 2015 +0100
     2.3 @@ -7180,6 +7180,7 @@
     2.4      </form>
     2.5    </notification>
     2.6  
     2.7 +  <!-- FS:Ansariel: WARNING: Read LLOfferInfo::forceResponse in llviewermessage.cpp before changing the button order!!! -->
     2.8    <notification
     2.9     icon="notify.tga"
    2.10     name="UserGiveItem"
    2.11 @@ -7210,7 +7211,6 @@
    2.12      </form>
    2.13    </notification>
    2.14  
    2.15 -  <!-- FS:Ansariel: WARNING: Read LLOfferInfo::forceResponse in llviewermessage.cpp before changing the button order!!! -->
    2.16    <notification
    2.17     icon="notify.tga"
    2.18     name="UserGiveItemLegacy"

mercurial