summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-19 17:18:53 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-19 17:18:53 +0200
commita2150863f97bf4fc49ecc17a2405177abe9d8f73 (patch)
treea7f2ca34d45ccf23854482d959ec4cf3e57528f1 /indra/llui
parent167be8f755ccc6e4af27cfce25506d666af58c25 (diff)
Updated normal task EXT-5905 - Resolving offers.
Reusable notifications are deleted when user closes IM floater(old - when user closes Viewer). --HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llnotifications.cpp16
-rw-r--r--indra/llui/llnotifications.h5
2 files changed, 14 insertions, 7 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 56ec8c4262..d7424cf05a 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -403,7 +403,8 @@ LLNotification::LLNotification(const LLNotification::Params& p) :
mPriority(p.priority),
mCancelled(false),
mIgnored(false),
- mResponderObj(NULL)
+ mResponderObj(NULL),
+ mIsReusable(false)
{
if (p.functor.name.isChosen())
{
@@ -432,7 +433,8 @@ LLNotification::LLNotification(const LLSD& sd) :
mRespondedTo(false),
mCancelled(false),
mIgnored(false),
- mResponderObj(NULL)
+ mResponderObj(NULL),
+ mIsReusable(false)
{
mId.generate();
mSubstitutions = sd["substitutions"];
@@ -459,6 +461,7 @@ LLSD LLNotification::asLLSD()
output["expiry"] = mExpiresAt;
output["priority"] = (S32)mPriority;
output["responseFunctor"] = mResponseFunctorName;
+ output["reusable"] = mIsReusable;
return output;
}
@@ -488,6 +491,7 @@ void LLNotification::updateFrom(LLNotificationPtr other)
mRespondedTo = other->mRespondedTo;
mResponse = other->mResponse;
mTemporaryResponder = other->mTemporaryResponder;
+ mIsReusable = other->isReusable();
update();
}
@@ -573,9 +577,7 @@ void LLNotification::respond(const LLSD& response)
// and then call it
functor(asLLSD(), response);
- bool is_resusable = getPayload()["reusable"].asBoolean();
-
- if (mTemporaryResponder && !is_resusable)
+ if (mTemporaryResponder && !isReusable())
{
LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
mResponseFunctorName = "";
@@ -879,11 +881,11 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt
{
abortProcessing = mChanged(payload);
// do not delete the notification to make LLChatHistory::appendMessage add notification panel to IM window
- if( ! pNotification->getPayload()["reusable"].asBoolean() )
+ if( ! pNotification->isReusable() )
{
mItems.erase(pNotification);
+ onDelete(pNotification);
}
- onDelete(pNotification);
}
}
return abortProcessing;
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index a516a6723e..400491a154 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -349,6 +349,7 @@ private:
ENotificationPriority mPriority;
LLNotificationFormPtr mForm;
void* mResponderObj;
+ bool mIsReusable;
// a reference to the template
LLNotificationTemplatePtr mTemplatep;
@@ -517,6 +518,10 @@ public:
{
return mId;
}
+
+ 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)