From 48dbcd1d431b4d50a9eab5be0577411470221cde Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 29 Jan 2014 18:16:04 -0500 Subject: STORM-2010: fix to AutoAcceptNewInventory --- indra/newview/llviewermessage.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3574d37adf..cd0d56152e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1875,6 +1875,7 @@ 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 @@ -1883,8 +1884,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) @@ -1952,7 +1952,7 @@ void inventory_offer_handler(LLOfferInfo* info) LLNotification::Params p; // Object -> Agent Inventory Offer - if (info->mFromObject) + if (info->mFromObject && !bAutoAccept) { // Inventory Slurls don't currently work for non agent transfers, so only display the object name. args["ITEM_SLURL"] = msg; @@ -1998,11 +1998,12 @@ void inventory_offer_handler(LLOfferInfo* info) send_do_not_disturb_message(gMessageSystem, info->mFromID); } - // Inform user that there is a script floater via toast system + if( !bAutoAccept ) // if we auto accept, do not pester the user { + // Inform user that there is a script floater via toast system payload["give_inventory_notification"] = TRUE; - p.payload = payload; - LLPostponedNotification::add(p, info->mFromID, false); + p.payload = payload; + LLPostponedNotification::add(p, info->mFromID, false); } } -- cgit v1.2.3 From 199e65a6c5584dfcdd24d6885dd9b19bf0af953a Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 24 Feb 2014 10:57:53 -0500 Subject: STORM-2015 Region restart sound alerts from all users on a STORM-1980 enabled viewer play inworld - should be local only. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 267aa9532c..d1524b74cd 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5985,7 +5985,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } } - send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); + make_ui_sound("UISndRestart"); } LLNotificationsUtil::add(notificationID, llsdBlock); -- cgit v1.2.3 From 2d6314f93fb5e7bf5f0494d8f9e746a647daa52b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 7 Mar 2014 12:50:08 -0500 Subject: STORM-2018 Group invite fails to let you join groups when groups maxed even when you leave group --- indra/newview/llviewermessage.cpp | 55 ++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 267aa9532c..9d80e0c04c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -644,25 +644,58 @@ void send_sound_trigger(const LLUUID& sound_id, F32 gain) gAgent.sendMessage(); } +static LLSD sSavedGroupInvite; +static LLSD sSavedResponse; + bool join_group_response(const LLSD& notification, const LLSD& response) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +// A bit of variable saving and restoring is used to deal with the case where your group list is full and you +// receive an invitation to another group. The data from that invitation is stored in the sSaved +// variables. If you then drop a group and click on the Join button the stored data is restored and used +// to join the group. + LLSD notification_adjusted = notification; + LLSD response_adjusted = response; + + std::string action = notification["name"]; + +// Storing all the information by group id allows for the rare case of being at your maximum +// group count and receiving more than one invitation. + std::string id = notification_adjusted["payload"]["group_id"].asString(); + + if ("JoinGroup" == action || "JoinGroupCanAfford" == action) + { + sSavedGroupInvite[id] = notification; + sSavedResponse[id] = response; + } + + if ("JoinedTooManyGroupsMember" == action) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == opt) // Join button pressed + { + notification_adjusted = sSavedGroupInvite[id]; + response_adjusted = sSavedResponse[id]; + } + } + + S32 option = LLNotificationsUtil::getSelectedOption(notification_adjusted, response_adjusted); bool accept_invite = false; - LLUUID group_id = notification["payload"]["group_id"].asUUID(); - LLUUID transaction_id = notification["payload"]["transaction_id"].asUUID(); - std::string name = notification["payload"]["name"].asString(); - std::string message = notification["payload"]["message"].asString(); - S32 fee = notification["payload"]["fee"].asInteger(); + LLUUID group_id = notification_adjusted["payload"]["group_id"].asUUID(); + LLUUID transaction_id = notification_adjusted["payload"]["transaction_id"].asUUID(); + std::string name = notification_adjusted["payload"]["name"].asString(); + std::string message = notification_adjusted["payload"]["message"].asString(); + S32 fee = notification_adjusted["payload"]["fee"].asInteger(); if (option == 2 && !group_id.isNull()) { LLGroupActions::show(group_id); LLSD args; args["MESSAGE"] = message; - LLNotificationsUtil::add("JoinGroup", args, notification["payload"]); + LLNotificationsUtil::add("JoinGroup", args, notification_adjusted["payload"]); return false; } + if(option == 0 && !group_id.isNull()) { // check for promotion or demotion. @@ -677,7 +710,8 @@ bool join_group_response(const LLSD& notification, const LLSD& response) { LLSD args; args["NAME"] = name; - LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification["payload"]); + LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification_adjusted["payload"]); + return false; } } @@ -691,7 +725,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) args["COST"] = llformat("%d", fee); // Set the fee for next time to 0, so that we don't keep // asking about a fee. - LLSD next_payload = notification["payload"]; + LLSD next_payload = notification_adjusted["payload"]; next_payload["fee"] = 0; LLNotificationsUtil::add("JoinGroupCanAfford", args, @@ -717,6 +751,9 @@ bool join_group_response(const LLSD& notification, const LLSD& response) transaction_id); } + sSavedGroupInvite[id] = LLSD::emptyMap(); + sSavedResponse[id] = LLSD::emptyMap(); + return false; } -- cgit v1.2.3 From 147c97dd0306f3df7e3f99b35c3098b56169a5dc Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 7 Mar 2014 15:08:58 -0500 Subject: STORM-2018 Added "else" per code review request. --- indra/newview/llviewermessage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9d80e0c04c..90551d641b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -667,8 +667,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) sSavedGroupInvite[id] = notification; sSavedResponse[id] = response; } - - if ("JoinedTooManyGroupsMember" == action) + else if ("JoinedTooManyGroupsMember" == action) { S32 opt = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == opt) // Join button pressed -- cgit v1.2.3