summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp32
-rwxr-xr-xindra/newview/llviewermessage.cpp5
2 files changed, 25 insertions, 12 deletions
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index f7af447a57..22f35752bd 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -164,22 +164,32 @@ void LLDoNotDisturbNotificationStorage::loadNotifications()
{
offerExists = true;
}
-
- //New notification needs to be added
- notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true));
- LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]);
- if (responder == NULL)
+
+ //Notification already exists due to persistent storage adding it first into the notification system
+ if(notification)
{
- LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '"
- << notification->getType() << "'" << LL_ENDL;
+ notification->setDND(true);
+ instance.update(instance.find(notificationID));
}
+ //New notification needs to be added
else
{
- LLNotificationResponderPtr responderPtr(responder);
- notification->setResponseFunctor(responderPtr);
+ notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true));
+ LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]);
+ if (responder == NULL)
+ {
+ LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '"
+ << notification->getType() << "'" << LL_ENDL;
+ }
+ else
+ {
+ LLNotificationResponderPtr responderPtr(responder);
+ notification->setResponseFunctor(responderPtr);
+ }
+
+ instance.add(notification);
}
-
- instance.add(notification);
+
}
if(imToastExists)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 6bbfd30794..2340436a01 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2615,7 +2615,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
payload["sender_name"] = name;
payload["group_id"] = group_id;
payload["inventory_name"] = item_name;
- payload["inventory_offer"] = info ? info->asLLSD() : LLSD();
+ if(info && info->asLLSD())
+ {
+ payload["inventory_offer"] = info->asLLSD();
+ }
LLSD args;
args["SUBJECT"] = subj;