fixed major EXT-6700 crash in LLNotificationsUI::LLHandlerUtil::addNotifPanelToIM

Utilized functionality of class LLPostponedNotification for adding offer notifications.

reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/249/

--HG--
branch : product-engine
meow-7.2.2
Alexei Arabadji 2010-04-16 15:08:26 +03:00
parent 8589d8175e
commit be039f30d6
1 changed files with 25 additions and 3 deletions

View File

@ -1636,6 +1636,18 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
return false;
}
class LLPostponedOfferNotification: public LLPostponedNotification
{
protected:
/* virtual */
void modifyNotificationParams()
{
LLSD substitutions = mParams.substitutions;
substitutions["NAME"] = mName;
mParams.substitutions = substitutions;
}
};
void inventory_offer_handler(LLOfferInfo* info)
{
//Until throttling is implmented, busy mode should reject inventory instead of silently
@ -1785,7 +1797,10 @@ void inventory_offer_handler(LLOfferInfo* info)
// Inform user that there is a script floater via toast system
{
payload["give_inventory_notification"] = TRUE;
LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload));
LLNotification::Params params(p.name);
params.substitutions = p.substitutions;
params.payload = p.payload;
LLPostponedNotification::add<LLPostponedOfferNotification>( params, info->mFromID, false);
}
}
}
@ -2557,7 +2572,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
payload["from_id"] = from_id;
payload["lure_id"] = session_id;
payload["godlike"] = FALSE;
LLNotificationsUtil::add("TeleportOffered", args, payload);
LLNotification::Params params("TeleportOffered");
params.substitutions = args;
params.payload = payload;
LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
}
}
break;
@ -2626,7 +2645,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
else
{
args["[MESSAGE]"] = message;
LLNotificationsUtil::add("OfferFriendship", args, payload);
LLNotification::Params params("OfferFriendship");
params.substitutions = args;
params.payload = payload;
LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
}
}
}