summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-09-27 09:46:20 -0700
committerRichard Nelson <none@none>2010-09-27 09:46:20 -0700
commitad440a68bb6a481f17ea8b0cb8f3cecf37502d51 (patch)
treeb41c81b55f73b6ebd4ee0a14dd195c07d7ce2d40 /indra/llui/llnotifications.cpp
parentb25d969b61eb1e4f114ee0e632d1de9777780e9f (diff)
parent57b8571a8acd559b7a92c2d5ffbfe96b0c4b5b98 (diff)
merge
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 67b3c5cfce..9a3933093c 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -133,12 +133,6 @@ private:
bool filterIgnoredNotifications(LLNotificationPtr notification)
{
- // filter everything if we are to ignore ALL
- if(LLNotifications::instance().getIgnoreAllNotifications())
- {
- return false;
- }
-
LLNotificationFormPtr form = notification->getForm();
// Check to see if the user wants to ignore this alert
return !notification->getForm()->getIgnored();
@@ -173,6 +167,20 @@ bool handleIgnoredNotification(const LLSD& payload)
return false;
}
+bool defaultResponse(const LLSD& payload)
+{
+ if (payload["sigtype"].asString() == "add")
+ {
+ LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
+ if (pNotif)
+ {
+ // supply default response
+ pNotif->respond(pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON));
+ }
+ }
+ return false;
+}
+
namespace LLNotificationFilters
{
// a sample filter
@@ -1187,9 +1195,11 @@ void LLNotifications::createDefaultChannels()
{
// now construct the various channels AFTER loading the notifications,
// because the history channel is going to rewrite the stored notifications file
- LLNotificationChannel::buildChannel("Expiration", "",
+ LLNotificationChannel::buildChannel("Enabled", "",
+ !boost::bind(&LLNotifications::getIgnoreAllNotifications, this));
+ LLNotificationChannel::buildChannel("Expiration", "Enabled",
boost::bind(&LLNotifications::expirationFilter, this, _1));
- LLNotificationChannel::buildChannel("Unexpired", "",
+ LLNotificationChannel::buildChannel("Unexpired", "Enabled",
!boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind
LLNotificationChannel::buildChannel("Unique", "Unexpired",
boost::bind(&LLNotifications::uniqueFilter, this, _1));
@@ -1203,6 +1213,8 @@ void LLNotifications::createDefaultChannels()
new LLPersistentNotificationChannel();
// connect action methods to these channels
+ LLNotifications::instance().getChannel("Enabled")->
+ connectFailedFilter(&defaultResponse);
LLNotifications::instance().getChannel("Expiration")->
connectChanged(boost::bind(&LLNotifications::expirationHandler, this, _1));
// uniqueHandler slot should be added as first slot of the signal due to