diff options
-rw-r--r-- | ChangeLog.txt | 9 | ||||
-rw-r--r-- | linden/indra/newview/llassetuploadresponders.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llpreview.cpp | 29 | ||||
-rw-r--r-- | linden/indra/newview/llpreview.h | 1 |
4 files changed, 40 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index a029365..4cdab70 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,12 @@ | |||
1 | 2009-10-17 McCabe Maxsted <hakushakukun@gmail.com> | ||
2 | |||
3 | * Ported notecard security fix from LL's 1.23.5 viewer. | ||
4 | |||
5 | modified: linden/indra/newview/llassetuploadresponders.cpp | ||
6 | modified: linden/indra/newview/llpreview.cpp | ||
7 | modified: linden/indra/newview/llpreview.h | ||
8 | |||
9 | |||
1 | 2009-10-16 McCabe Maxsted <hakushakukun@gmail.com> | 10 | 2009-10-16 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 11 | ||
3 | * Applied RLVa-1.0.4e_20091010_SL-1.22.11-diff.patch. | 12 | * Applied RLVa-1.0.4e_20091010_SL-1.22.11-diff.patch. |
diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp index be3882e..311ff64 100644 --- a/linden/indra/newview/llassetuploadresponders.cpp +++ b/linden/indra/newview/llassetuploadresponders.cpp | |||
@@ -440,7 +440,6 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) | |||
440 | { | 440 | { |
441 | case LLAssetType::AT_NOTECARD: | 441 | case LLAssetType::AT_NOTECARD: |
442 | { | 442 | { |
443 | |||
444 | // Update the UI with the new asset. | 443 | // Update the UI with the new asset. |
445 | LLPreviewNotecard* nc; | 444 | LLPreviewNotecard* nc; |
446 | nc = (LLPreviewNotecard*)LLPreview::find(item_id); | 445 | nc = (LLPreviewNotecard*)LLPreview::find(item_id); |
@@ -459,6 +458,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) | |||
459 | LLAssetType::AT_NOTECARD); | 458 | LLAssetType::AT_NOTECARD); |
460 | } | 459 | } |
461 | 460 | ||
461 | nc->setAssetId(content["new_asset"].asUUID()); | ||
462 | nc->refreshFromInventory(); | 462 | nc->refreshFromInventory(); |
463 | } | 463 | } |
464 | } | 464 | } |
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp index 1a6d2ca..055851b 100644 --- a/linden/indra/newview/llpreview.cpp +++ b/linden/indra/newview/llpreview.cpp | |||
@@ -596,3 +596,32 @@ void LLMultiPreview::setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& | |||
596 | sAutoOpenPreviewHandles[id] = previewp->getHandle(); | 596 | sAutoOpenPreviewHandles[id] = previewp->getHandle(); |
597 | } | 597 | } |
598 | } | 598 | } |
599 | |||
600 | void LLPreview::setAssetId(const LLUUID& asset_id) | ||
601 | { | ||
602 | const LLViewerInventoryItem* item = getItem(); | ||
603 | if(NULL == item) | ||
604 | { | ||
605 | return; | ||
606 | } | ||
607 | |||
608 | if(mObjectUUID.isNull()) | ||
609 | { | ||
610 | // Update avatar inventory asset_id. | ||
611 | LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); | ||
612 | new_item->setAssetUUID(asset_id); | ||
613 | gInventory.updateItem(new_item); | ||
614 | gInventory.notifyObservers(); | ||
615 | } | ||
616 | else | ||
617 | { | ||
618 | // Update object inventory asset_id. | ||
619 | LLViewerObject* object = gObjectList.findObject(mObjectUUID); | ||
620 | if(NULL == object) | ||
621 | { | ||
622 | llwarns << "LLPreview::setAssetId() called on unrecognized object, UUID : " << mObjectUUID << llendl; | ||
623 | return; | ||
624 | } | ||
625 | object->updateViewerInventoryAsset(item, asset_id); | ||
626 | } | ||
627 | } | ||
diff --git a/linden/indra/newview/llpreview.h b/linden/indra/newview/llpreview.h index 74daca6..4e159f3 100644 --- a/linden/indra/newview/llpreview.h +++ b/linden/indra/newview/llpreview.h | |||
@@ -83,6 +83,7 @@ public: | |||
83 | void setItemID(const LLUUID& item_id); | 83 | void setItemID(const LLUUID& item_id); |
84 | void setObjectID(const LLUUID& object_id); | 84 | void setObjectID(const LLUUID& object_id); |
85 | void setSourceID(const LLUUID& source_id); | 85 | void setSourceID(const LLUUID& source_id); |
86 | void setAssetId(const LLUUID& asset_id); | ||
86 | const LLViewerInventoryItem *getItem() const; // searches if not constructed with it | 87 | const LLViewerInventoryItem *getItem() const; // searches if not constructed with it |
87 | 88 | ||
88 | static LLPreview* find(const LLUUID& item_uuid); | 89 | static LLPreview* find(const LLUUID& item_uuid); |