From 5df9d52d48b56a5d8f36a45ced0393c99473f536 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 12 Dec 2012 18:49:07 -0800 Subject: CHUI-499: Refactoring the persistent notification storage so that I can reuse the functionality for do-not-disturb mode. --- indra/newview/llnotificationstorage.h | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'indra/newview/llnotificationstorage.h') diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h index 8635c797c0..ab4da4e73f 100644 --- a/indra/newview/llnotificationstorage.h +++ b/indra/newview/llnotificationstorage.h @@ -27,32 +27,24 @@ #ifndef LL_NOTIFICATIONSTORAGE_H #define LL_NOTIFICATIONSTORAGE_H -#include "llnotifications.h" - -// Class that saves not responded(unread) notifications. -// Unread notifications are saved in open_notifications.xml in SL account folder -// -// Notifications that should be saved(if unread) are marked with persist="true" in notifications.xml -// Notifications using functor responders are saved automatically (see llviewermessage.cpp -// lure_callback_reg for example). -// Notifications using object responders(LLOfferInfo) need additional tuning. Responder object should -// be a) serializable(implement LLNotificationResponderInterface), -// b) registered with LLResponderRegistry (found in llnotificationstorage.cpp). -class LLPersistentNotificationStorage : public LLSingleton -{ - LOG_CLASS(LLPersistentNotificationStorage); -public: +#include - LLPersistentNotificationStorage(); +#include "llerror.h" - void saveNotifications(); +class LLSD; - void loadNotifications(); - -private: +class LLNotificationStorage +{ + LOG_CLASS(LLNotificationStorage); +public: + LLNotificationStorage(std::string pFileName); + ~LLNotificationStorage(); - bool onPersistentChannelChanged(const LLSD& payload); +protected: + bool writeNotifications(const LLSD& pNotificationData) const; + bool readNotifications(LLSD& pNotificationData) const; +private: std::string mFileName; }; -- cgit v1.2.3 From 6b9ead91459d702727b54ab7e51614c2d5959f5f Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 23:07:27 -0800 Subject: CHUI-499: Refactoring the LLPersistentNotificationStorage implementation for shared usage with the new LLDoNotDisturbNotificationStorage class. --- indra/newview/llnotificationstorage.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llnotificationstorage.h') diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h index ab4da4e73f..7aabf7d09e 100644 --- a/indra/newview/llnotificationstorage.h +++ b/indra/newview/llnotificationstorage.h @@ -31,6 +31,7 @@ #include "llerror.h" +class LLNotificationResponderInterface; class LLSD; class LLNotificationStorage @@ -44,6 +45,8 @@ protected: bool writeNotifications(const LLSD& pNotificationData) const; bool readNotifications(LLSD& pNotificationData) const; + LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams) const; + private: std::string mFileName; }; -- cgit v1.2.3