summaryrefslogtreecommitdiff
path: root/indra/newview/rlvhandler.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-10 18:16:05 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-10 18:16:05 +0800
commitaf6a85ef15a3de2d4051a012b4f06c0df510a858 (patch)
treef08c3bba0a7f18a4338281032f3d68af4ef4bbe7 /indra/newview/rlvhandler.cpp
parenta9b5563065fa4768072bbe2ffc023cc73675d701 (diff)
@getinv[:folder1/...]=<channel> implementation
The collar I happen to have issued @getinv:.outfits/=98745923, so I just assume ignoring folders beginning with a dot only applies to the answer, not the command.
Diffstat (limited to 'indra/newview/rlvhandler.cpp')
-rw-r--r--indra/newview/rlvhandler.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 57275af54a..413d3758e4 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -243,13 +243,26 @@ ECmdRet ReplyHandler<EBehaviour::GetSitID>::onCommand(const RlvCommand& rlvCmd,
template<> template<>
ECmdRet ReplyHandler<EBehaviour::GetInv>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
{
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- auto rlvFolderID = findDescendentCategoryIDByName(gInventory.getRootFolderID(), "#RLV");
- if (rlvFolderID == LLUUID::null)
+ auto folderID = findDescendentCategoryIDByName(gInventory.getRootFolderID(), "#RLV");
+ if (folderID == LLUUID::null)
return ECmdRet::FailedNoSharedRoot;
strReply = "";
- gInventory.getDirectDescendentsOf(rlvFolderID, cats, items);
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ std::vector<std::string> optionList;
+ auto option = rlvCmd.getOption();
+ if (!option.empty())
+ {
+ Util::parseStringList(option, optionList, "/");
+ auto optIter = optionList.begin();
+ for(; optionList.end() != optIter; ++optIter)
+ {
+ auto name = *optIter;
+ if (!name.empty())
+ folderID = findDescendentCategoryIDByName(folderID, name);
+ }
+ }
+ gInventory.getDirectDescendentsOf(folderID, cats, items);
auto iter = cats->begin();
for(; cats->end() != iter; ++iter)
{