summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2010-04-16 15:08:26 +0300
committerAlexei Arabadji <aarabadji@productengine.com>2010-04-16 15:08:26 +0300
commitbe039f30d661cf419378e6a6f0f72ee8f1cca8a5 (patch)
treef6a038f23f553630e7d43f7010d3a90e18aad76d /indra/newview/llviewermessage.cpp
parent8589d8175e71665237384b36d591d7de7e2fa7dd (diff)
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
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ab35df1101..360c6be2c6 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -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);
}
}
}