summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2016-05-10 16:09:25 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2016-05-10 16:09:25 +0300
commitb1243c55e5579f72e3dd9dafe2b53173349a047f (patch)
tree9d9e0b018059483973a8e6f76644b0875d2534a3 /indra/llcommon/llevents.cpp
parent042930b59a82f706f16e4b67a683697aed65112f (diff)
parent7f5e6cea124e1193b199a3eabd50bdab96340c13 (diff)
Merged in oz_linden/maint-5974
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rwxr-xr-xindra/llcommon/llevents.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 1c928b3db8..645c29d770 100755
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -132,6 +132,17 @@ LLEventPump& LLEventPumps::obtain(const std::string& name)
return *newInstance;
}
+bool LLEventPumps::post(const std::string&name, const LLSD&message)
+{
+ PumpMap::iterator found = mPumpMap.find(name);
+
+ if (found == mPumpMap.end())
+ return false;
+
+ return (*found).second->post(message);
+}
+
+
void LLEventPumps::flush()
{
// Flush every known LLEventPump instance. Leave it up to each instance to
@@ -497,6 +508,43 @@ bool LLEventStream::post(const LLSD& event)
}
/*****************************************************************************
+ * LLEventMailDrop
+ *****************************************************************************/
+bool LLEventMailDrop::post(const LLSD& event)
+{
+ bool posted = false;
+
+ if (!mSignal->empty())
+ posted = LLEventStream::post(event);
+
+ if (!posted)
+ { // if the event was not handled we will save it for later so that it can
+ // be posted to any future listeners when they attach.
+ mEventHistory.push_back(event);
+ }
+
+ return posted;
+}
+
+LLBoundListener LLEventMailDrop::listen_impl(const std::string& name,
+ const LLEventListener& listener,
+ const NameList& after,
+ const NameList& before)
+{
+ if (!mEventHistory.empty())
+ {
+ if (listener(mEventHistory.front()))
+ {
+ mEventHistory.pop_front();
+ }
+ }
+
+ return LLEventStream::listen_impl(name, listener, after, before);
+
+}
+
+
+/*****************************************************************************
* LLEventQueue
*****************************************************************************/
bool LLEventQueue::post(const LLSD& event)