From 1ea65f0285d7022ce20ef84d4e35e3c94bcb3fbd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Mar 2012 22:56:02 -0700 Subject: CHUI-51 WIP notifications routig code cleanup phase 1, removal of most of llnotificationhandler --- indra/llui/llnotifications.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 462d69be2e..f83365a97d 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -513,7 +513,10 @@ public: std::string getURL() const; S32 getURLOption() const; S32 getURLOpenExternally() const; - + bool canLogToChat() const; + bool canLogToIM() const; + bool hasFormElements() const; + const LLNotificationFormPtr getForm(); const LLDate getExpiration() const @@ -791,13 +794,6 @@ typedef boost::shared_ptr LLNotificationChannelPtr; // of a queue with notifications being added to different nonequivalent copies. So we // make it inherit from boost::noncopyable, and then create a map of shared_ptr to manage it. // -// NOTE: LLNotificationChannel is self-registering. The *correct* way to create one is to -// do something like: -// LLNotificationChannel::buildChannel("name", "parent"...); -// This returns an LLNotificationChannelPtr, which you can store, or -// you can then retrieve the channel by using the registry: -// LLNotifications::instance().getChannel("name")... -// class LLNotificationChannel : boost::noncopyable, public LLNotificationChannelBase @@ -822,20 +818,13 @@ public: std::string summarize(); - // factory method for constructing these channels; since they're self-registering, - // we want to make sure that you can't use new to make them - static LLNotificationChannelPtr buildChannel(const std::string& name, const std::string& parent, - LLNotificationFilter filter=LLNotificationFilters::includeEverything, - LLNotificationComparator comparator=LLNotificationComparators::orderByUUID()); - -protected: // Notification Channels have a filter, which determines which notifications // will be added to this channel. // Channel filters cannot change. // Channels have a protected constructor so you can't make smart pointers that don't // come from our internal reference; call NotificationChannel::build(args) LLNotificationChannel(const std::string& name, const std::string& parent, - LLNotificationFilter filter, LLNotificationComparator comparator); + LLNotificationFilter filter, LLNotificationComparator comparator=LLNotificationComparators::orderByUUID()); private: std::string mName; -- cgit v1.2.3 From 2fa1c42aadbe2a29e1bcced9a487c0e5abf0602b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 29 Mar 2012 23:48:29 -0700 Subject: CHUI-51 WIP notifications routig code cleanup phase 2, removal of extraneous signaling in favor of llnotificationchannels made notificationchannels work better with overrides and lifetime managed by creator --- indra/llui/llnotifications.h | 49 ++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 18 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index f83365a97d..344108ecbf 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -94,10 +94,11 @@ // and we need this to manage the notification callbacks #include "llevents.h" #include "llfunctorregistry.h" -#include "llpointer.h" #include "llinitparam.h" #include "llnotificationslistener.h" #include "llnotificationptr.h" +#include "llpointer.h" +#include "llrefcount.h" class LLAvatarName; typedef enum e_notification_priority @@ -707,7 +708,8 @@ typedef std::multimap LLNotificationMap; // all of the built-in tests should attach to the "Visible" channel // class LLNotificationChannelBase : - public LLEventTrackable + public LLEventTrackable, + public LLRefCount { LOG_CLASS(LLNotificationChannelBase); public: @@ -787,26 +789,48 @@ protected: // destroy it, but if it becomes necessary to do so, the shared_ptr model // will ensure that we don't leak resources. class LLNotificationChannel; -typedef boost::shared_ptr LLNotificationChannelPtr; +typedef boost::intrusive_ptr LLNotificationChannelPtr; // manages a list of notifications // Note that if this is ever copied around, we might find ourselves with multiple copies // of a queue with notifications being added to different nonequivalent copies. So we -// make it inherit from boost::noncopyable, and then create a map of shared_ptr to manage it. +// make it inherit from boost::noncopyable, and then create a map of LLPointer to manage it. // class LLNotificationChannel : boost::noncopyable, - public LLNotificationChannelBase + public LLNotificationChannelBase, + public LLInstanceTracker { LOG_CLASS(LLNotificationChannel); public: + // Notification Channels have a filter, which determines which notifications + // will be added to this channel. + // Channel filters cannot change. + struct Params : public LLInitParam::Block + { + Mandatory name; + Optional filter; + Optional comparator; + Multiple sources; + + Params() + : comparator("", LLNotificationComparators::orderByUUID()) + {} + }; + + LLNotificationChannel(const Params& p = Params()); + + LLNotificationChannel(const std::string& name, const std::string& parent, + LLNotificationFilter filter, LLNotificationComparator comparator=LLNotificationComparators::orderByUUID()); + virtual ~LLNotificationChannel() {} typedef LLNotificationSet::iterator Iterator; std::string getName() const { return mName; } - std::string getParentChannelName() { return mParent; } + void connectToChannel(const std::string& channel_name); + bool isEmpty() const; Iterator begin(); @@ -818,14 +842,6 @@ public: std::string summarize(); - // Notification Channels have a filter, which determines which notifications - // will be added to this channel. - // Channel filters cannot change. - // Channels have a protected constructor so you can't make smart pointers that don't - // come from our internal reference; call NotificationChannel::build(args) - LLNotificationChannel(const std::string& name, const std::string& parent, - LLNotificationFilter filter, LLNotificationComparator comparator=LLNotificationComparators::orderByUUID()); - private: std::string mName; std::string mParent; @@ -912,10 +928,6 @@ public: void createDefaultChannels(); - typedef std::map ChannelMap; - ChannelMap mChannels; - - void addChannel(LLNotificationChannelPtr pChan); LLNotificationChannelPtr getChannel(const std::string& channelName); std::string getGlobalString(const std::string& key) const; @@ -954,6 +966,7 @@ private: bool mIgnoreAllNotifications; boost::scoped_ptr mListener; + std::vector mDefaultChannels; }; /** -- cgit v1.2.3 From c2afd200a0d55c5137de6f89200a8d4b09ba8b6e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 30 Mar 2012 18:36:43 -0700 Subject: CHUI-51 WIP notifications routing code cleanup object inventory offers don't increment system menu count added customizable merging behavior for duplicate "unique" notifications fixed overeager notification channels --- indra/llui/llnotifications.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 344108ecbf..4e2b997156 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -297,6 +297,7 @@ LOG_CLASS(LLNotification); friend class LLNotifications; public: + // parameter object used to instantiate a new notification struct Params : public LLInitParam::Block { @@ -518,6 +519,13 @@ public: bool canLogToIM() const; bool hasFormElements() const; + typedef enum e_combine_behavior + { + USE_NEWEST, + USE_OLDEST + } ECombineBehavior; + + ECombineBehavior getCombineBehavior() const; const LLNotificationFormPtr getForm(); const LLDate getExpiration() const -- cgit v1.2.3 From 296e55c1b323c05b6544b69ace04afe19102396b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 18 May 2012 13:20:32 -0700 Subject: CHUI-112 FIX Clicking Show or Discard in an inventory offer toast does not dismiss toast removed special case logic for dealing with user online/offline collisions added ability to cancel old duplicate notifications --- indra/llui/llnotifications.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 21a4318aab..e9449eae69 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -165,6 +165,7 @@ public: struct FormElementBase : public LLInitParam::Block { Optional name; + Optional enabled; FormElementBase(); }; @@ -234,16 +235,20 @@ public: } EIgnoreType; LLNotificationForm(); + LLNotificationForm(const LLNotificationForm&); LLNotificationForm(const LLSD& sd); LLNotificationForm(const std::string& name, const Params& p); + void fromLLSD(const LLSD& sd); LLSD asLLSD() const; S32 getNumElements() { return mFormData.size(); } LLSD getElement(S32 index) { return mFormData.get(index); } LLSD getElement(const std::string& element_name); - bool hasElement(const std::string& element_name); - void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD()); + bool hasElement(const std::string& element_name) const; + bool getElementEnabled(const std::string& element_name) const; + void setElementEnabled(const std::string& element_name, bool enabled); + void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD(), bool enabled = true); void formatElements(const LLSD& substitutions); // appends form elements from another form serialized as LLSD void append(const LLSD& sub_form); @@ -450,6 +455,11 @@ public: // ["responseFunctor"] = name of registered functor that handles responses to notification; LLSD asLLSD(); + const LLNotificationFormPtr getForm(); + void updateForm(const LLNotificationFormPtr& form); + + void repost(); + void respond(const LLSD& sd); void respondWithDefault(); @@ -517,16 +527,18 @@ public: S32 getURLOpenExternally() const; bool canLogToChat() const; bool canLogToIM() const; + bool canShowToast() const; bool hasFormElements() const; typedef enum e_combine_behavior { - USE_NEWEST, - USE_OLDEST + REPLACE_WITH_NEW, + KEEP_OLD, + CANCEL_OLD + } ECombineBehavior; ECombineBehavior getCombineBehavior() const; - const LLNotificationFormPtr getForm(); const LLDate getExpiration() const { @@ -545,8 +557,6 @@ public: bool isReusable() { return mIsReusable; } - void setReusable(bool reusable) { mIsReusable = reusable; } - // comparing two notifications normally means comparing them by UUID (so we can look them // up quickly this way) bool operator<(const LLNotification& rhs) const -- cgit v1.2.3 From 61bc25211be31ad28b8ae342c17b4ea1c32d955c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 21 May 2012 17:16:11 -0700 Subject: CHUI-111 FIX Saved notifications are not sorted in same order after logout and relog. sort notifications in separate list llnotification now uses param block to serialize to llsd --- indra/llui/llnotifications.h | 148 ++++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 71 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index e9449eae69..783e9ffc88 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -88,10 +88,6 @@ #include #include -// we want to minimize external dependencies, but this one is important -#include "llsd.h" - -// and we need this to manage the notification callbacks #include "llevents.h" #include "llfunctorregistry.h" #include "llinitparam.h" @@ -99,6 +95,7 @@ #include "llnotificationptr.h" #include "llpointer.h" #include "llrefcount.h" +#include "llsdparam.h" class LLAvatarName; typedef enum e_notification_priority @@ -309,13 +306,13 @@ public: friend class LLNotification; Mandatory name; - - // optional - Optional substitutions; - Optional payload; + Optional id; + Optional substitutions, + form_elements, + payload; Optional priority; - Optional form_elements; - Optional time_stamp; + Optional time_stamp, + expiry; Optional context; Optional responder; @@ -326,7 +323,7 @@ public: Alternative responder; Functor() - : name("functor_name"), + : name("responseFunctor"), function("functor"), responder("responder") {} @@ -335,10 +332,13 @@ public: Params() : name("name"), + id("id"), priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), - time_stamp("time_stamp"), + time_stamp("time"), payload("payload"), - form_elements("form_elements") + form_elements("form"), + substitutions("substitutions"), + expiry("expiry") { time_stamp = LLDate::now(); responder = NULL; @@ -347,9 +347,11 @@ public: Params(const std::string& _name) : name("name"), priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), - time_stamp("time_stamp"), + time_stamp("time"), payload("payload"), - form_elements("form_elements") + form_elements("form"), + substitutions("substitutions"), + expiry("expiry") { functor.name = _name; name = _name; @@ -362,7 +364,7 @@ public: private: - LLUUID mId; + const LLUUID mId; LLSD mPayload; LLSD mSubstitutions; LLDate mTimestamp; @@ -374,7 +376,6 @@ private: ENotificationPriority mPriority; LLNotificationFormPtr mForm; void* mResponderObj; // TODO - refactor/remove this field - bool mIsReusable; LLNotificationResponderPtr mResponder; // a reference to the template @@ -399,18 +400,10 @@ private: void init(const std::string& template_name, const LLSD& form_elements); - LLNotification(const Params& p); - - // this is just for making it easy to look things up in a set organized by UUID -- DON'T USE IT - // for anything real! - LLNotification(LLUUID uuid) : mId(uuid), mCancelled(false), mRespondedTo(false), mIgnored(false), mPriority(NOTIFICATION_PRIORITY_UNSPECIFIED), mTemporaryResponder(false) {} - void cancel(); public: - - // constructor from a saved notification - LLNotification(const LLSD& sd); + LLNotification(const LLSDParamAdapter& p); void setResponseFunctor(std::string const &responseFunctorName); @@ -555,8 +548,6 @@ public: return mId; } - bool isReusable() { return mIsReusable; } - // comparing two notifications normally means comparing them by UUID (so we can look them // up quickly this way) bool operator<(const LLNotification& rhs) const @@ -668,44 +659,18 @@ namespace LLNotificationFilters namespace LLNotificationComparators { - typedef enum e_direction { ORDER_DECREASING, ORDER_INCREASING } EDirection; - - // generic order functor that takes method or member variable reference - template - struct orderBy + struct orderByUUID { - typedef boost::function field_t; - orderBy(field_t field, EDirection direction = ORDER_INCREASING) : mField(field), mDirection(direction) {} bool operator()(LLNotificationPtr lhs, LLNotificationPtr rhs) { - if (mDirection == ORDER_DECREASING) - { - return mField(lhs) > mField(rhs); - } - else - { - return mField(lhs) < mField(rhs); - } + return lhs->id() < rhs->id(); } - - field_t mField; - EDirection mDirection; - }; - - struct orderByUUID : public orderBy - { - orderByUUID(EDirection direction = ORDER_INCREASING) : orderBy(&LLNotification::id, direction) {} - }; - - struct orderByDate : public orderBy - { - orderByDate(EDirection direction = ORDER_INCREASING) : orderBy(&LLNotification::getDate, direction) {} }; }; typedef boost::function LLNotificationFilter; typedef boost::function LLNotificationComparator; -typedef std::set LLNotificationSet; +typedef std::set LLNotificationSet; typedef std::multimap LLNotificationMap; // ======================================================== @@ -731,8 +696,9 @@ class LLNotificationChannelBase : { LOG_CLASS(LLNotificationChannelBase); public: - LLNotificationChannelBase(LLNotificationFilter filter, LLNotificationComparator comp) : - mFilter(filter), mItems(comp) + LLNotificationChannelBase(LLNotificationFilter filter) + : mFilter(filter), + mItems() {} virtual ~LLNotificationChannelBase() {} // you can also connect to a Channel, so you can be notified of @@ -829,18 +795,11 @@ public: { Mandatory name; Optional filter; - Optional comparator; Multiple sources; - - Params() - : comparator("", LLNotificationComparators::orderByUUID()) - {} }; LLNotificationChannel(const Params& p = Params()); - - LLNotificationChannel(const std::string& name, const std::string& parent, - LLNotificationFilter filter, LLNotificationComparator comparator=LLNotificationComparators::orderByUUID()); + LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter); virtual ~LLNotificationChannel() {} typedef LLNotificationSet::iterator Iterator; @@ -853,11 +812,8 @@ public: Iterator begin(); Iterator end(); + size_t size(); - // Channels have a comparator to control sort order; - // the default sorts by arrival date - void setComparator(LLNotificationComparator comparator); - std::string summarize(); private: @@ -1047,5 +1003,55 @@ protected: std::string mName; }; +// Stores only persistent notifications. +// Class users can use connectChanged() to process persistent notifications +// (see LLNotificationStorage for example). +class LLPersistentNotificationChannel : public LLNotificationChannel +{ + LOG_CLASS(LLPersistentNotificationChannel); +public: + LLPersistentNotificationChannel() + : LLNotificationChannel("Persistent", "Visible", ¬ificationFilter) + { + } + + typedef std::vector history_list_t; + history_list_t::iterator beginHistory() { sortHistory(); return mHistory.begin(); } + history_list_t::iterator endHistory() { return mHistory.end(); } + +private: + + void sortHistory() + { + struct sortByTime + { + S32 operator ()(const LLNotificationPtr& a, const LLNotificationPtr& b) + { + return a->getDate() < b->getDate(); + } + }; + std::sort(mHistory.begin(), mHistory.end(), sortByTime()); + } + + + // The channel gets all persistent notifications except those that have been canceled + static bool notificationFilter(LLNotificationPtr pNotification) + { + bool handle_notification = false; + + handle_notification = pNotification->isPersistent() + && !pNotification->isCancelled(); + + return handle_notification; + } + + void onAdd(LLNotificationPtr p) + { + mHistory.push_back(p); + } + + std::vector mHistory; +}; + #endif//LL_LLNOTIFICATIONS_H -- cgit v1.2.3 From 4dffa3351401bd8ba8326958b38a3d500805b5d1 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 22 May 2012 20:34:34 +0300 Subject: Linux build fix GCC does not allow local functor classes to be used with template algorithms, because template arguments must refer to an entity with external linkage. --- indra/llui/llnotifications.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 783e9ffc88..12479f0788 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -1021,15 +1021,16 @@ public: private: - void sortHistory() + struct sortByTime { - struct sortByTime + S32 operator ()(const LLNotificationPtr& a, const LLNotificationPtr& b) { - S32 operator ()(const LLNotificationPtr& a, const LLNotificationPtr& b) - { - return a->getDate() < b->getDate(); - } - }; + return a->getDate() < b->getDate(); + } + }; + + void sortHistory() + { std::sort(mHistory.begin(), mHistory.end(), sortByTime()); } -- cgit v1.2.3 From 6e2b3527cc95b92bf136b65fd2ee344d4c879faa Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Fri, 2 Nov 2012 13:22:48 -0700 Subject: CHUI-475: Ensuring that objects that query the avatar name cache with a callback store the connection and disconnect on object destruction. This should help resolve some of the heap corruption we are seeing. --- indra/llui/llnotifications.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 19b30b8973..c677dfe298 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -87,6 +87,7 @@ #include #include #include +#include #include "llevents.h" #include "llfunctorregistry.h" @@ -972,14 +973,15 @@ public: thiz->mParams = params; // Avoid header file dependency on llcachename.h - lookupName(thiz, id, is_group); + thiz->lookupName(id, is_group); } private: - static void lookupName(LLPostponedNotification* thiz, const LLUUID& id, bool is_group); + void lookupName(const LLUUID& id, bool is_group); // only used for groups void onGroupNameCache(const LLUUID& id, const std::string& full_name, bool is_group); // only used for avatars + void fetchAvatarName(const LLUUID& id); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); // used for both group and avatar names void finalizeName(const std::string& name); @@ -990,8 +992,19 @@ private: } protected: - LLPostponedNotification() {} - virtual ~LLPostponedNotification() {} + LLPostponedNotification() + : mParams(), + mName(), + mAvatarNameCacheConnection() + {} + + virtual ~LLPostponedNotification() + { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } + } /** * Abstract method provides possibility to modify notification parameters and @@ -1002,6 +1015,7 @@ protected: LLNotification::Params mParams; std::string mName; + boost::signals2::connection mAvatarNameCacheConnection; }; // Stores only persistent notifications. -- cgit v1.2.3 From d3474c6eaf5f26986e7988f4ca773f67e034c49d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 15 Nov 2012 15:42:22 -0800 Subject: CHUI-489: Now sounds exist for teleport and inventory offers. The sound is specified in notifications.xml. Also changes for CHUI 486, which allow the user to set preferences for hearing sounds for a New Conversation, Incoming Voice Call, Teleport Offer and Inventory Offer. --- indra/llui/llnotifications.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index c677dfe298..088931858a 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -524,6 +524,7 @@ public: bool canLogToIM() const; bool canShowToast() const; bool hasFormElements() const; + void playSound(); typedef enum e_combine_behavior { -- cgit v1.2.3 From 60c72c85e2360284ecc3326871dcc76fcce0e945 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 3 Dec 2012 19:06:52 -0800 Subject: Cleaning up some unreferenced member variables and related types from LLNotifications. --- indra/llui/llnotifications.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 088931858a..a41e9fa5a3 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -92,7 +92,6 @@ #include "llevents.h" #include "llfunctorregistry.h" #include "llinitparam.h" -#include "llnotificationslistener.h" #include "llnotificationptr.h" #include "llpointer.h" #include "llrefcount.h" @@ -672,7 +671,6 @@ namespace LLNotificationComparators }; typedef boost::function LLNotificationFilter; -typedef boost::function LLNotificationComparator; typedef std::set LLNotificationSet; typedef std::multimap LLNotificationMap; @@ -822,7 +820,6 @@ public: private: std::string mName; std::string mParent; - LLNotificationComparator mComparator; }; // An interface class to provide a clean linker seam to the LLNotifications class. @@ -942,7 +939,6 @@ private: bool mIgnoreAllNotifications; - boost::scoped_ptr mListener; std::vector mDefaultChannels; }; -- cgit v1.2.3 From fc000880b40143534c47c475a7a0aba6ab75039e Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 5 Dec 2012 20:47:21 +0200 Subject: CHUI-519 FIXED Do not put offered items into the trash while in Busy / DND mode --- indra/llui/llnotifications.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 088931858a..372b9ce46f 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -316,6 +316,7 @@ public: expiry; Optional context; Optional responder; + Optional offer_from_agent; struct Functor : public LLInitParam::ChoiceBlock { @@ -339,7 +340,8 @@ public: payload("payload"), form_elements("form"), substitutions("substitutions"), - expiry("expiry") + expiry("expiry"), + offer_from_agent("offer_from_agent", false) { time_stamp = LLDate::now(); responder = NULL; @@ -352,7 +354,8 @@ public: payload("payload"), form_elements("form"), substitutions("substitutions"), - expiry("expiry") + expiry("expiry"), + offer_from_agent("offer_from_agent", false) { functor.name = _name; name = _name; @@ -378,6 +381,7 @@ private: LLNotificationFormPtr mForm; void* mResponderObj; // TODO - refactor/remove this field LLNotificationResponderPtr mResponder; + bool mOfferFromAgent; // a reference to the template LLNotificationTemplatePtr mTemplatep; @@ -513,6 +517,11 @@ public: return mTimestamp; } + bool getOfferFromAgent() const + { + return mOfferFromAgent; + } + std::string getType() const; std::string getMessage() const; std::string getFooter() const; -- cgit v1.2.3 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/llui/llnotifications.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 056a316d40..8bb79b57e3 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -1026,7 +1026,7 @@ protected: // Stores only persistent notifications. // Class users can use connectChanged() to process persistent notifications -// (see LLNotificationStorage for example). +// (see LLPersistentNotificationStorage for example). class LLPersistentNotificationChannel : public LLNotificationChannel { LOG_CLASS(LLPersistentNotificationChannel); -- cgit v1.2.3 From c73947ac1fc6c48bca75ea7d6beeda63eb695b2b Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 18:48:15 -0800 Subject: CHUI-499: Adding ability to serialize the communication notifications to local disk per user. --- indra/llui/llnotifications.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 8bb79b57e3..42dee4c3e9 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -774,6 +774,9 @@ protected: virtual void onDelete(LLNotificationPtr p) {} virtual void onChange(LLNotificationPtr p) {} + virtual void onFilterPass(LLNotificationPtr p) {} + virtual void onFilterFail(LLNotificationPtr p) {} + bool updateItem(const LLSD& payload, LLNotificationPtr pNotification); LLNotificationFilter mFilter; }; -- cgit v1.2.3 From aa6fee292d1721eac6f0f1f270844e01e06979d4 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 3 Jan 2013 14:19:04 -0800 Subject: CHUI-499: Fixed a serialization problem where the a notification's objectInfo was not being serialized/deserialized. --- indra/llui/llnotifications.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 42dee4c3e9..2a6391f49e 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -322,11 +322,13 @@ public: Alternative name; Alternative function; Alternative responder; + Alternative responder_sd; Functor() : name("responseFunctor"), function("functor"), - responder("responder") + responder("responder"), + responder_sd("responder_sd") {} }; Optional functor; -- cgit v1.2.3 From 02ca16c1334d1409d8b14136f76305686796c359 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 4 Jan 2013 17:58:30 -0800 Subject: CHUI-499: Now when existing DND mode, stored IM's will not show a toast but instead flash the conversation line item and Chat FUI button. --- indra/llui/llnotifications.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2a6391f49e..092a9acd7c 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -316,6 +316,7 @@ public: Optional context; Optional responder; Optional offer_from_agent; + Optional is_dnd; struct Functor : public LLInitParam::ChoiceBlock { @@ -342,7 +343,8 @@ public: form_elements("form"), substitutions("substitutions"), expiry("expiry"), - offer_from_agent("offer_from_agent", false) + offer_from_agent("offer_from_agent", false), + is_dnd("is_dnd", false) { time_stamp = LLDate::now(); responder = NULL; @@ -356,7 +358,8 @@ public: form_elements("form"), substitutions("substitutions"), expiry("expiry"), - offer_from_agent("offer_from_agent", false) + offer_from_agent("offer_from_agent", false), + is_dnd("is_dnd", false) { functor.name = _name; name = _name; @@ -383,6 +386,7 @@ private: void* mResponderObj; // TODO - refactor/remove this field LLNotificationResponderPtr mResponder; bool mOfferFromAgent; + bool mIsDND; // a reference to the template LLNotificationTemplatePtr mTemplatep; @@ -523,6 +527,16 @@ public: return mOfferFromAgent; } + bool isDND() const + { + return mIsDND; + } + + void setDND(const bool flag) + { + mIsDND = flag; + } + std::string getType() const; std::string getMessage() const; std::string getFooter() const; -- cgit v1.2.3 From 974720373d608a8cbcd3cd26c125b6487b5926a2 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 8 Jan 2013 12:21:47 -0800 Subject: CHUI-660: Problem: Upon auto-existing DND mode upon startup, the notification form elements (buttonts) were added to the form. But then deserialized form elements were also being added to the form causing duplicate buttons. As a solution, only add on the deserialized form elements that exceed the amount in the template. --- indra/llui/llnotifications.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 092a9acd7c..96e0a86b7f 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -246,6 +246,7 @@ public: bool getElementEnabled(const std::string& element_name) const; void setElementEnabled(const std::string& element_name, bool enabled); void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD(), bool enabled = true); + void addElement(const LLSD &element); void formatElements(const LLSD& substitutions); // appends form elements from another form serialized as LLSD void append(const LLSD& sub_form); -- cgit v1.2.3 From b5172de28fd6bb8a833cf93180d2d43dd9d4a073 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 8 Jan 2013 17:06:49 -0800 Subject: CHUI-660: Post code review changes --- indra/llui/llnotifications.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 96e0a86b7f..236c2a42d1 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -242,11 +242,11 @@ public: S32 getNumElements() { return mFormData.size(); } LLSD getElement(S32 index) { return mFormData.get(index); } LLSD getElement(const std::string& element_name); + void getElements(LLSD& elements, S32 offset = 0); bool hasElement(const std::string& element_name) const; bool getElementEnabled(const std::string& element_name) const; void setElementEnabled(const std::string& element_name, bool enabled); void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD(), bool enabled = true); - void addElement(const LLSD &element); void formatElements(const LLSD& substitutions); // appends form elements from another form serialized as LLSD void append(const LLSD& sub_form); @@ -457,7 +457,7 @@ public: // ["time"] = time at which notification was generated; // ["expiry"] = time at which notification expires; // ["responseFunctor"] = name of registered functor that handles responses to notification; - LLSD asLLSD(); + LLSD asLLSD(bool excludeTemplateElements = false); const LLNotificationFormPtr getForm(); void updateForm(const LLNotificationFormPtr& form); -- cgit v1.2.3 From b7f4916b3e4af149d6212a701c556915e23e7c0a Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 15 Jan 2013 02:48:52 +0000 Subject: CHUI-679 FIX Crash when script floater appears in CHUI viewer LLPostponedNotification now inherits from LLMortician so it can postpone its deletion. This prevents a crash when looking up an avatar name in the case where the name already exists in the cache. --- indra/llui/llnotifications.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui/llnotifications.h') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 236c2a42d1..e02c58de44 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -92,6 +92,7 @@ #include "llevents.h" #include "llfunctorregistry.h" #include "llinitparam.h" +#include "llmortician.h" #include "llnotificationptr.h" #include "llpointer.h" #include "llrefcount.h" @@ -981,7 +982,7 @@ private: * 1 create class derived from LLPostponedNotification; * 2 call LLPostponedNotification::add method; */ -class LLPostponedNotification +class LLPostponedNotification : public LLMortician { public: /** @@ -1014,7 +1015,7 @@ private: void cleanup() { - delete this; + die(); } protected: -- cgit v1.2.3