From 9f540f10e687bb3889de191afbae3b52cc21f415 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 15 May 2024 18:50:51 +0300 Subject: Add trusted flag to UI callbacks, so not everything is accessible from the script --- indra/newview/scripts/lua/UI.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/scripts/lua/UI.lua') diff --git a/indra/newview/scripts/lua/UI.lua b/indra/newview/scripts/lua/UI.lua index f851632bad..6101c7a312 100644 --- a/indra/newview/scripts/lua/UI.lua +++ b/indra/newview/scripts/lua/UI.lua @@ -1,16 +1,17 @@ -- Engage the UI LLEventAPI leap = require 'leap' +util = require 'util' local UI = {} function UI.call(func, parameter) -- 'call' is fire-and-forget - leap.send('UI', {op='call', ['function']=func, parameter=parameter}) + util.check_response(leap.request('UI', {op='call', ['function']=func, parameter=parameter})) end function UI.getValue(path) - return leap.request('UI', {op='getValue', path=path})['value'] + return util.check_response(leap.request('UI', {op='getValue', path=path}))['value'] end return UI -- cgit v1.2.3 From f08a3c80d61795bb1fc0e576948bca3362ef8e6c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 31 May 2024 20:03:13 +0300 Subject: Cherry-pick leap.lua changes; other clean up --- indra/newview/scripts/lua/UI.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/scripts/lua/UI.lua') diff --git a/indra/newview/scripts/lua/UI.lua b/indra/newview/scripts/lua/UI.lua index 6101c7a312..24f822bbd9 100644 --- a/indra/newview/scripts/lua/UI.lua +++ b/indra/newview/scripts/lua/UI.lua @@ -1,17 +1,16 @@ -- Engage the UI LLEventAPI leap = require 'leap' -util = require 'util' local UI = {} function UI.call(func, parameter) -- 'call' is fire-and-forget - util.check_response(leap.request('UI', {op='call', ['function']=func, parameter=parameter})) + leap.request('UI', {op='call', ['function']=func, parameter=parameter}) end function UI.getValue(path) - return util.check_response(leap.request('UI', {op='getValue', path=path}))['value'] + return leap.request('UI', {op='getValue', path=path})['value'] end return UI -- cgit v1.2.3