Added a method to access a named folder in a users inventory, to the inventory Database interfaces. This could be useful for adding a item to a users inventory from say a web front end application or some other third party application. [note the method is only currently implemented in the sqlite provider]

ThreadPoolClientBranch
MW 2008-02-13 14:45:13 +00:00
parent c202a7d0aa
commit 49a5a00b80
4 changed files with 36 additions and 0 deletions

View File

@ -88,5 +88,13 @@ namespace OpenSim.Framework.Communications
/// <param name="userID"></param>
/// <returns></returns>
List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID);
/// <summary>
/// Returns the named folder in that users inventory, returns null if folder is not found.
/// </summary>
/// <param name="userID"></param>
/// <param name="folderName"></param>
/// <returns></returns>
InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName);
}
}

View File

@ -140,6 +140,12 @@ namespace OpenSim.Framework.Communications
return RequestUsersRoot(userID);
}
// See IInventoryServices
public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
{
return null;
}
// See IInventoryServices
public void CreateNewUserInventory(LLUUID user)
{

View File

@ -100,6 +100,23 @@ namespace OpenSim.Region.Communications.Local
}
}
public override InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
{
List<InventoryFolderBase> folders = RequestFirstLevelFolders(userID);
InventoryFolderBase requestedFolder = null;
//need to make sure we send root folder first
foreach (InventoryFolderBase folder in folders)
{
if (folder.name == folderName)
{
requestedFolder = folder;
break;
}
}
return requestedFolder;
}
/// <summary>
/// Send the given inventory folder and its item contents back to the requester.

View File

@ -175,6 +175,11 @@ namespace OpenSim.Region.Communications.OGS1
return null;
}
public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
{
return null;
}
public void CreateNewUserInventory(LLUUID user)
{
}