summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDmitry Oleshko <doleshko@productengine.com>2009-11-16 14:34:38 +0200
committerDmitry Oleshko <doleshko@productengine.com>2009-11-16 14:34:38 +0200
commit154f501cb19ee99ab9fdb41b918478f18b220f40 (patch)
treefe30f4fedc2e012156156b92f0a287c18b4e58dc /indra
parenteeaeca81b9a0d35b12c047497dc388593b2e9f29 (diff)
fixed normal bug (EXT-2503) Clicking on (x) button in Message Well Window doesn't dismiss a group notice
Added to the handler of group notices functionality on rejecting of notifications. This behavior was broken earlier in the handler for script notifications. --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnotificationgrouphandler.cpp14
-rw-r--r--indra/newview/llnotificationhandler.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp
index fc6fb25644..26730e1f10 100644
--- a/indra/newview/llnotificationgrouphandler.cpp
+++ b/indra/newview/llnotificationgrouphandler.cpp
@@ -37,6 +37,7 @@
#include "llgroupactions.h"
#include "llviewercontrol.h"
#include "llviewerwindow.h"
+#include "llnotificationmanager.h"
using namespace LLNotificationsUI;
@@ -47,6 +48,9 @@ LLGroupHandler::LLGroupHandler(e_notification_type type, const LLSD& id)
// Getting a Channel for our notifications
mChannel = LLChannelManager::getInstance()->createNotificationChannel();
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ if(channel)
+ channel->setOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
}
//--------------------------------------------------------------------------
@@ -118,5 +122,15 @@ void LLGroupHandler::onDeleteToast(LLToast* toast)
}
//--------------------------------------------------------------------------
+void LLGroupHandler::onRejectToast(LLUUID& id)
+{
+ LLNotificationPtr notification = LLNotifications::instance().find(id);
+
+ if (notification && LLNotificationManager::getInstance()->getHandlerForNotification(notification->getType()) == this)
+ {
+ LLNotifications::instance().cancel(notification);
+ }
+}
+//--------------------------------------------------------------------------
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 23998a0e5d..42cc7cacc2 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -209,6 +209,9 @@ public:
protected:
virtual void onDeleteToast(LLToast* toast);
virtual void initChannel();
+
+ // own handlers
+ void onRejectToast(LLUUID& id);
};
/**