diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-09-02 15:34:54 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-09-02 15:34:54 -0400 |
commit | 592ebc9ec63b3c1e636fdd96c68353f97e298506 (patch) | |
tree | aaabef7c55dd0a8007bae0ff1120e3abf4a5bd88 | |
parent | 0440fe4dccc44c9474c1ee05c506370350b94320 (diff) |
VWR-22695 FIXED Adding attachments messaging is inefficient
Superficial code cleanup of RezAttachment messaging.
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7a5d4356d..78b5c10748 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -101,7 +101,7 @@ void dec_busy_count() void remove_inventory_category_from_avatar(LLInventoryCategory* category); void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); -bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); +bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); // +=================================================+ @@ -4025,19 +4025,15 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - LLSD payload; payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; + payload["is_add"] = !replace; if (replace && (attachment && attachment->getNumObjects() > 0)) { - LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); + LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_attachment_rez); } else { @@ -4045,7 +4041,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } -bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response) +bool confirm_attachment_rez(const LLSD& notification, const LLSD& response) { if (!gAgentAvatarp->canAttachMoreObjects()) { @@ -4088,14 +4084,16 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon // attachments are batched up all into one message versus each attachment // being sent in its own separate attachments message. U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); + BOOL is_add = notification["payload"]["is_add"].asBoolean(); + LLAttachmentsMgr::instance().addAttachment(item_id, attachment_pt, - FALSE); + is_add); } } return false; } -static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_replace_attachment_rez); +static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_attachment_rez); void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { |