LLViewerRegion WIP: Use LLViewerRegion::getCapAPI

Viewer 3 uses this in LLAgent::setStartPosition and
copy_inventory_from_notecard; so I brought those
up to speed with V3.

The viewer now uses LLViewerRegion::getCapAPI in all
the same place as V3.
This commit is contained in:
Aleric Inglewood
2012-02-18 02:12:15 +01:00
parent b8744b9e6a
commit f381b0c2dd
2 changed files with 53 additions and 42 deletions

View File

@@ -911,7 +911,11 @@ public:
}
};
void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id)
void copy_inventory_from_notecard(/* V3: const LLUUID& destination_id, */
const LLUUID& object_id,
const LLUUID& notecard_inv_id,
const LLInventoryItem *src,
U32 callback_id)
{
if (NULL == src)
{
@@ -930,7 +934,7 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
// Fallback to the agents region if for some reason the
// object isn't found in the viewer.
if(!viewer_region)
if (! viewer_region)
{
viewer_region = gAgent.getRegion();
}
@@ -958,9 +962,13 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
body["object-id"] = object_id;
body["item-id"] = src->getUUID();
body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
// V3: body["folder-id"] = destination_id;
body["callback-id"] = (LLSD::Integer)callback_id;
LLHTTPClient::post(url, body, new LLCopyInventoryFromNotecardResponder());
request["message"] = "CopyInventoryFromNotecard";
request["payload"] = body;
viewer_region->getCapAPI().post(request);
}