CHUI-758: Group notice received in DND mode causes crash on startup when auto-exiting DND mode. Crash occurred because two instances of the Group Notice notification were trying to be added from the persistent storage and then the DND storage.

meow-7.2.2
Gilbert Gonzales 2013-02-12 12:31:59 -08:00
parent 8aaedd0a5f
commit b1d03f940d
2 changed files with 25 additions and 12 deletions

View File

@ -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)

View File

@ -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;