diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 56522bc819..d88a6f1a9b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5424,36 +5424,42 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) int regionAccess = llsdBlock["_region_access"].asInteger(); llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); - // we're going to throw the LLSD in there in case anyone ever wants to use it - LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); - + bool returnValue = false; + LLNotificationPtr maturityLevelNotification; if (regionAccess == SIM_ACCESS_MATURE) { if (gAgent.isTeen()) { - LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + returnValue = true; } else if (gAgent.prefersPG()) { - LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + returnValue = true; } } else if (regionAccess == SIM_ACCESS_ADULT) { if (!gAgent.isAdult()) { - LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + returnValue = true; } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + returnValue = true; } } - return false; + + if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + { + // Given a simple notification if no maturityLevelNotification is set or it is ignore + LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); + } + + return returnValue; } bool attempt_standard_notification(LLMessageSystem* msgsystem) |