From 0e44480705631ffe6a1f3086527411ecebfc0ec7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 Dec 2009 14:24:21 -0500 Subject: Add event API to enumerate registered LLCommandHandler instances. --- indra/newview/llcommanddispatcherlistener.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llcommanddispatcherlistener.cpp') diff --git a/indra/newview/llcommanddispatcherlistener.cpp b/indra/newview/llcommanddispatcherlistener.cpp index 00a20de30e..91baeaf989 100644 --- a/indra/newview/llcommanddispatcherlistener.cpp +++ b/indra/newview/llcommanddispatcherlistener.cpp @@ -31,6 +31,11 @@ LLCommandDispatcherListener::LLCommandDispatcherListener(/* LLCommandDispatcher* "[\"query\"] map of parameters, as if from ?key1=val&key2=val\n" "[\"trusted\"] boolean indicating trusted browser [default true]", &LLCommandDispatcherListener::dispatch); + add("enumerate", + "Post to [\"reply\"] a map of registered LLCommandHandler instances, containing\n" + "name key and (e.g.) untrusted flag", + &LLCommandDispatcherListener::enumerate, + LLSD().with("reply", LLSD())); } void LLCommandDispatcherListener::dispatch(const LLSD& params) const @@ -45,3 +50,11 @@ void LLCommandDispatcherListener::dispatch(const LLSD& params) const LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], NULL, trusted_browser); } + +void LLCommandDispatcherListener::enumerate(const LLSD& params) const +{ + LLReqID reqID(params); + LLSD response(LLCommandDispatcher::enumerate()); + reqID.stamp(response); + LLEventPumps::instance().obtain(params["reply"]).post(response); +} -- cgit v1.2.3