summaryrefslogtreecommitdiff
path: root/indra/newview/llassetuploadresponders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llassetuploadresponders.cpp')
-rw-r--r--indra/newview/llassetuploadresponders.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 8441796219..2bd3728ab7 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -202,13 +202,19 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content)
LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data,
const LLUUID& vfile_id,
- LLAssetType::EType asset_type)
-: LLAssetUploadResponder(post_data, vfile_id, asset_type)
+ LLAssetType::EType asset_type,
+ boost::function<void(const LLUUID& uuid)> callback)
+: LLAssetUploadResponder(post_data, vfile_id, asset_type),
+ mCallback(callback)
{
}
-LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type)
-: LLAssetUploadResponder(post_data, file_name, asset_type)
+LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data,
+ const std::string& file_name,
+ LLAssetType::EType asset_type,
+ boost::function<void(const LLUUID& uuid)> callback)
+: LLAssetUploadResponder(post_data, file_name, asset_type),
+ mCallback(callback)
{
}
@@ -286,6 +292,12 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
creation_date_now);
gInventory.updateItem(item);
gInventory.notifyObservers();
+
+ if (mCallback)
+ {
+ // call the callback with the new Asset UUID
+ mCallback(item->getAssetUUID());
+ }
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
@@ -333,13 +345,11 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
U32 group_perms = mPostData.has("group_mask") ? mPostData.get("group_mask" ).asInteger() : PERM_NONE;
U32 next_owner_perms = mPostData.has("next_owner_mask") ? mPostData.get("next_owner_mask").asInteger() : PERM_NONE;
std::string display_name = LLStringUtil::null;
- LLAssetStorage::LLStoreAssetCallback callback = NULL;
- void *userdata = NULL;
upload_new_resource(next_file, asset_name, asset_name,
- 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
+ LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
next_owner_perms, group_perms,
everyone_perms, display_name,
- callback, expected_upload_cost, userdata);
+ NULL, expected_upload_cost);
}
}