summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventcoro.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lleventcoro.h')
-rwxr-xr-xindra/llcommon/lleventcoro.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index bcc8cdda1d..acf2ad24a4 100755
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -32,6 +32,7 @@
#include <boost/optional.hpp>
#include <string>
#include <stdexcept>
+#include <utility> // std::pair
#include "llevents.h"
#include "llerror.h"
@@ -75,6 +76,8 @@ private:
namespace llcoro
{
+typedef std::pair<LLSD, bool*> LLSD_consumed;
+
/// This is an adapter for a signature like void LISTENER(const LLSD&), which
/// isn't a valid LLEventPump listener: such listeners should return bool.
template <typename LISTENER>
@@ -84,11 +87,13 @@ public:
VoidListener(const LISTENER& listener):
mListener(listener)
{}
+
bool operator()(const LLSD& event)
{
- mListener(event);
- // don't swallow the event, let other listeners see it
- return false;
+ bool consumed = false;
+ mListener(LLSD_consumed(event, &consumed));
+ // tell upstream LLEventPump whether listener consumed
+ return consumed;
}
private:
LISTENER mListener;