aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerinventory.cpp')
-rw-r--r--linden/indra/newview/llviewerinventory.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp
index add9f27..bbd6cd4 100644
--- a/linden/indra/newview/llviewerinventory.cpp
+++ b/linden/indra/newview/llviewerinventory.cpp
@@ -48,6 +48,8 @@
48#include "llviewerregion.h" 48#include "llviewerregion.h"
49#include "llviewerobjectlist.h" 49#include "llviewerobjectlist.h"
50#include "llpreviewgesture.h" 50#include "llpreviewgesture.h"
51#include "llviewerwindow.h"
52
51///---------------------------------------------------------------------------- 53///----------------------------------------------------------------------------
52/// Local function declarations, constants, enums, and typedefs 54/// Local function declarations, constants, enums, and typedefs
53///---------------------------------------------------------------------------- 55///----------------------------------------------------------------------------
@@ -213,6 +215,14 @@ void LLViewerInventoryItem::fetchFromServer(void) const
213} 215}
214 216
215// virtual 217// virtual
218BOOL LLViewerInventoryItem::unpackMessage(LLSD item)
219{
220 BOOL rv = LLInventoryItem::fromLLSD(item);
221 mIsComplete = TRUE;
222 return rv;
223}
224
225// virtual
216BOOL LLViewerInventoryItem::unpackMessage( 226BOOL LLViewerInventoryItem::unpackMessage(
217 LLMessageSystem* msg, const char* block, S32 block_num) 227 LLMessageSystem* msg, const char* block, S32 block_num)
218{ 228{
@@ -420,30 +430,42 @@ void LLViewerInventoryCategory::removeFromServer( void )
420bool LLViewerInventoryCategory::fetchDescendents() 430bool LLViewerInventoryCategory::fetchDescendents()
421{ 431{
422 if((VERSION_UNKNOWN == mVersion) 432 if((VERSION_UNKNOWN == mVersion)
423 && mDescendentsRequested.hasExpired()) 433 && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads.
424 { 434 {
425 const F32 FETCH_TIMER_EXPIRY = 10.0f; 435 const F32 FETCH_TIMER_EXPIRY = 10.0f;
426 mDescendentsRequested.reset(); 436 mDescendentsRequested.reset();
427 mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY); 437 mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY);
428 438
429 LLMessageSystem* msg = gMessageSystem;
430 msg->newMessage("FetchInventoryDescendents");
431 msg->nextBlock("AgentData");
432 msg->addUUID("AgentID", gAgent.getID());
433 msg->addUUID("SessionID", gAgent.getSessionID());
434 msg->nextBlock("InventoryData");
435 msg->addUUID("FolderID", mUUID);
436 msg->addUUID("OwnerID", mOwnerID);
437 // bitfield 439 // bitfield
438 // 1 = by date 440 // 1 = by date
439 // 2 = folders by date 441 // 2 = folders by date
440 // Need to mask off anything but the first bit. 442 // Need to mask off anything but the first bit.
441 // This comes from LLInventoryFilter from llfolderview.h 443 // This comes from LLInventoryFilter from llfolderview.h
442 U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1; 444 U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1;
443 msg->addS32("SortOrder", sort_order); 445
444 msg->addBOOL("FetchFolders", FALSE); 446 std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents");
445 msg->addBOOL("FetchItems", TRUE); 447
446 gAgent.sendReliableMessage(); 448 if (!url.empty()) //Capability found. Build up LLSD and use it.
449 {
450 LLInventoryModel::startBackgroundFetch(mUUID);
451 }
452 else
453 { //Deprecated, but if we don't have a capability, use the old system.
454 llinfos << "FetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl;
455 LLMessageSystem* msg = gMessageSystem;
456 msg->newMessage("FetchInventoryDescendents");
457 msg->nextBlock("AgentData");
458 msg->addUUID("AgentID", gAgent.getID());
459 msg->addUUID("SessionID", gAgent.getSessionID());
460 msg->nextBlock("InventoryData");
461 msg->addUUID("FolderID", mUUID);
462 msg->addUUID("OwnerID", mOwnerID);
463
464 msg->addS32("SortOrder", sort_order);
465 msg->addBOOL("FetchFolders", FALSE);
466 msg->addBOOL("FetchItems", TRUE);
467 gAgent.sendReliableMessage();
468 }
447 return true; 469 return true;
448 } 470 }
449 return false; 471 return false;