From 6f1fabf0e09662a2d0467fcc487ff6189fc5133c Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 15 Jun 2011 09:23:46 -0700 Subject: Fix VWR-24099: warn user when trying to send too many teleport offers at one time. --- indra/newview/llviewermessage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3832be727f..435b2e063d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6266,6 +6266,15 @@ void send_group_notice(const LLUUID& group_id, bool handle_lure_callback(const LLSD& notification, const LLSD& response) { + if(notification["payload"]["ids"].size() > 250) + { + // More than 250 targets will overload the message. + LLSD args; + args["OFFERS"] = notification["payload"]["ids"].size(); + LLNotificationsUtil::add("TooManyTeleportOffers", args); + return false; + } + std::string text = response["message"].asString(); LLSLURL slurl; LLAgentUI::buildSLURL(slurl); -- cgit v1.2.3 From 0fb93246b36b356362e1899eab2d67c8931d9471 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 15 Jun 2011 15:12:42 -0700 Subject: Fix VWR-24099: disable teleport button when too many friends are selected; we keep the warning dialog as a failsafe. --- indra/newview/llviewermessage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 435b2e063d..ae36a2292f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6266,11 +6266,14 @@ void send_group_notice(const LLUUID& group_id, bool handle_lure_callback(const LLSD& notification, const LLSD& response) { - if(notification["payload"]["ids"].size() > 250) + static const unsigned OFFER_RECIPIENT_LIMIT = 250; + if(notification["payload"]["ids"].size() > OFFER_RECIPIENT_LIMIT) { - // More than 250 targets will overload the message. + // More than OFFER_RECIPIENT_LIMIT targets will overload the message + // producing an llerror. LLSD args; args["OFFERS"] = notification["payload"]["ids"].size(); + args["LIMIT"] = static_cast(OFFER_RECIPIENT_LIMIT); LLNotificationsUtil::add("TooManyTeleportOffers", args); return false; } -- cgit v1.2.3