CHUI-489: Found a bug in last commit for this issue. The sound notification (for inventory/teleport offer) would be played for the toast popup as well as once the conversations floater was opened. And also when a button was clicked in the conversation floater to 'accept' or 'deny' the offer. Now only playing the sound notification when the initial offer has been made.

master
Gilbert Gonzales 2012-11-15 17:34:34 -08:00
parent e775e95416
commit 89f7335a52
2 changed files with 17 additions and 13 deletions

View File

@ -117,6 +117,23 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
channel->addToast(p);
bool playSound = true;
//Play notification sound for inventory offer and teleport offer based upon chat preference
if((notification->getName() == "UserGiveItem"
&& gSavedSettings.getBOOL("PlaySoundInventoryOffer") == FALSE)
|| notification->getName() == "TeleportOffered"
&& gSavedSettings.getBOOL("PlaySoundTeleportOffer") == FALSE)
{
playSound = false;
}
if(playSound)
{
notification->playSound();
}
}
if (notification->canLogToIM())

View File

@ -494,20 +494,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
// adjust panel's height to the text size
snapToMessageHeight(mTextBox, MAX_LENGTH);
bool playSound = true;
if((mNotification->getName() == "UserGiveItem"
&& gSavedSettings.getBOOL("PlaySoundInventoryOffer") == FALSE)
|| mNotification->getName() == "TeleportOffered"
&& gSavedSettings.getBOOL("PlaySoundTeleportOffer") == FALSE)
{
playSound = false;
}
if(playSound)
{
mNotification->playSound();
}
}