Cancel hidden notifications instead of using empty responses.

This is more work on EXP-111.

Reviewed by Richard.
master
Monroe Williams 2010-09-30 12:18:49 -07:00
parent 900d23ffe1
commit cd2b9b45fa
1 changed files with 12 additions and 1 deletions

View File

@ -196,6 +196,17 @@ bool emptyResponse(const LLSD& payload)
return false;
}
bool cancelNotification(const LLSD& payload)
{
if (payload["sigtype"].asString() == "add")
{
// cancel this notification
LLNotifications::instance().cancel(LLNotifications::instance().find(payload["id"].asUUID()));
}
return false;
}
namespace LLNotificationFilters
{
// a sample filter
@ -1252,7 +1263,7 @@ void LLNotifications::createDefaultChannels()
LLNotifications::instance().getChannel("Ignore")->
connectFailedFilter(&handleIgnoredNotification);
LLNotifications::instance().getChannel("VisibilityRules")->
connectFailedFilter(&emptyResponse);
connectFailedFilter(&cancelNotification);
}
bool LLNotifications::addTemplate(const std::string &name,