summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2026-07-23 14:17:48 -0700
committerRider Linden <rider@lindenlab.com>2026-07-23 14:58:16 -0700
commit285e0a41b0ad676a7015a237dd828eb686da1c14 (patch)
treea5c3ca8eff362a54af04a10a9b0df39ddcb62798
parenta6a2f98070cd55fcaadafc237bd0ffba9d466655 (diff)
Was not correctly parsing metadata from task inventory API, fix how I was using the cache control.
-rw-r--r--indra/llinventory/llinventory.cpp30
-rw-r--r--indra/newview/llscripteditorws.cpp28
-rw-r--r--indra/newview/llscripteditorws.h8
3 files changed, 57 insertions, 9 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 1fcf70dc25..a7edc3a383 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -63,6 +63,7 @@ static const std::string INV_CREATION_DATE_LABEL("created_at");
static const std::string INV_TOGGLED_LABEL("toggled");
static const std::string INV_SCRIPT_LABEL("script");
static const std::string INV_RUNTIME_LABEL("runtime");
+static const std::string INV_METADATA_LABEL("metadata");
// key used by agent-inventory-service
static const std::string INV_ASSET_TYPE_LABEL_WS("type_default");
@@ -1114,6 +1115,35 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
continue;
}
+ if (i->first == INV_METADATA_LABEL)
+ {
+ // Server (non-AIS) exports thumbnail/favorite/script nested under
+ // a "metadata" wrapper; mirror the legacy-stream parser behavior.
+ const LLSD& metadata = i->second;
+ if (metadata.has(INV_THUMBNAIL_LABEL))
+ {
+ const LLSD& thumbnail = metadata[INV_THUMBNAIL_LABEL];
+ if (thumbnail.has(INV_ASSET_ID_LABEL))
+ {
+ mThumbnailUUID = thumbnail[INV_ASSET_ID_LABEL].asUUID();
+ }
+ }
+ if (metadata.has(INV_FAVORITE_LABEL))
+ {
+ const LLSD& favorite = metadata[INV_FAVORITE_LABEL];
+ if (favorite.has(INV_TOGGLED_LABEL))
+ {
+ mFavorite = favorite[INV_TOGGLED_LABEL].asBoolean();
+ }
+ }
+ if (metadata.has(INV_SCRIPT_LABEL)
+ && metadata[INV_SCRIPT_LABEL].has(INV_RUNTIME_LABEL))
+ {
+ mRuntime = metadata[INV_SCRIPT_LABEL][INV_RUNTIME_LABEL].asString();
+ }
+ continue;
+ }
+
if (i->first == INV_PERMISSIONS_LABEL)
{
mPermissions.importLLSD(i->second);
diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp
index e0bf9b0b61..555affe9a1 100644
--- a/indra/newview/llscripteditorws.cpp
+++ b/indra/newview/llscripteditorws.cpp
@@ -156,11 +156,11 @@ namespace
}
return std::string(s);
}
-}
-LLCachedControl<bool> LLScriptEditorWSServer::sEnableScriptEditorWS(gSavedSettings, "ExternalWebsocketSyncEnable", false);
-LLCachedControl<bool> LLScriptEditorWSServer::sTightIntegration(gSavedSettings, "ExternalEditorTightIntegration", false);
+ LLCachedControl<bool>* OPT_ENABLESCRIPTEDITORWS(nullptr);
+ LLCachedControl<bool>* OPT_TIGHTINTEGRATION(nullptr);
+}
class LLPublishedPrimListener : public LLVOInventoryListener
{
@@ -203,8 +203,8 @@ private:
};
//========================================================================
-LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only)
- : LLJSONRPCServer(name, port, local_only)
+LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only):
+ LLJSONRPCServer(name, port, local_only)
{
LL_INFOS("ScriptEditorWS") << "Created JSON-RPC script editor server: " << name
<< " on port " << port << LL_ENDL;
@@ -221,6 +221,24 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer()
wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME));
}
+bool LLScriptEditorWSServer::isEnabled()
+{
+ if (!OPT_ENABLESCRIPTEDITORWS)
+ {
+ OPT_ENABLESCRIPTEDITORWS = new LLCachedControl<bool>(gSavedSettings, "ExternalWebsocketSyncEnable", false);
+ }
+ return *OPT_ENABLESCRIPTEDITORWS;
+}
+
+bool LLScriptEditorWSServer::isTightIntegration()
+{
+ if (!OPT_TIGHTINTEGRATION)
+ {
+ OPT_TIGHTINTEGRATION = new LLCachedControl<bool>(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false);
+ }
+ return *OPT_TIGHTINTEGRATION;
+}
+
LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning()
{
if (!LLScriptEditorWSServer::isEnabled())
diff --git a/indra/newview/llscripteditorws.h b/indra/newview/llscripteditorws.h
index 33b19f8a97..de64b6946d 100644
--- a/indra/newview/llscripteditorws.h
+++ b/indra/newview/llscripteditorws.h
@@ -211,8 +211,8 @@ public:
void onLinksetChildAdded(const LLUUID& root_id, LLViewerObject* child);
void onLinksetChildRemoved(const LLUUID& root_id, const LLUUID& child_id);
- static bool isEnabled() { return sEnableScriptEditorWS; }
- static bool isTightIntegration() { return sTightIntegration; }
+ static bool isEnabled();
+ static bool isTightIntegration();
protected:
LLWebsocketMgr::WSConnection::ptr_t connectionFactory(LLWebsocketMgr::WSServer::ptr_t server,
@@ -354,6 +354,6 @@ private:
static constexpr F32 CLEANUP_INTERVAL = 60.0f; // seconds
static constexpr F32 CONNECTION_TIMEOUT = 300.0f; // 5 minutes
- static LLCachedControl<bool> sEnableScriptEditorWS;
- static LLCachedControl<bool> sTightIntegration;
+ LLCachedControl<bool> *mEnableScriptEditorWS;
+ LLCachedControl<bool> *mTightIntegration;
};