Change non-visible notifications to return empty response instead of default.

This is part of EXP-111.

Reviewed by Richard.
master
Monroe Linden 2010-09-29 16:51:21 -07:00
parent af4b224700
commit 27f6b2ea7d
1 changed files with 15 additions and 1 deletions

View File

@ -182,6 +182,20 @@ bool defaultResponse(const LLSD& payload)
return false;
}
bool emptyResponse(const LLSD& payload)
{
if (payload["sigtype"].asString() == "add")
{
LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
if (pNotif)
{
// supply empty response
pNotif->respond(pNotif->getResponseTemplate(LLNotification::WITHOUT_DEFAULT_BUTTON));
}
}
return false;
}
namespace LLNotificationFilters
{
// a sample filter
@ -1238,7 +1252,7 @@ void LLNotifications::createDefaultChannels()
LLNotifications::instance().getChannel("Ignore")->
connectFailedFilter(&handleIgnoredNotification);
LLNotifications::instance().getChannel("VisibilityRules")->
connectFailedFilter(&handleIgnoredNotification);
connectFailedFilter(&emptyResponse);
}
bool LLNotifications::addTemplate(const std::string &name,