summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llnotificationslistener.cpp29
-rw-r--r--indra/llui/llnotificationslistener.h5
2 files changed, 32 insertions, 2 deletions
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index d6e552ca5c..6ebbee68ac 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -24,5 +24,32 @@ LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications
void LLNotificationsListener::requestAdd(const LLSD& event_data) const
{
- mNotifications.add(event_data["name"], event_data["substitutions"], event_data["payload"]);
+ if(event_data.has("reply"))
+ {
+ mNotifications.add(event_data["name"],
+ event_data["substitutions"],
+ event_data["payload"],
+ boost::bind(&LLNotificationListener::Responder,
+ this,
+ event_data["reply"].asString(),
+ _1, _2
+ )
+ );
+ }
+ else
+ {
+ mNotifications.add(event_data["name"],
+ event_data["substitutions"],
+ event_data["payload"]);
+ }
+}
+
+void LLNotificationsListener::Responder(const std::string& reply_pump,
+ const LLSD& notification,
+ const LLSD& response)
+{
+ LLSD reponse_event;
+ reponse_event["notification"] = notification;
+ reponse_event["response"] = response;
+ mEventPumps.obtain(reply_pump).post(reponse_event);
}
diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h
index 3576cacbdb..d11aed1b52 100644
--- a/indra/llui/llnotificationslistener.h
+++ b/indra/llui/llnotificationslistener.h
@@ -25,7 +25,10 @@ public:
void requestAdd(LLSD const & event_data) const;
private:
- LLNotifications & mNotifications;
+ void NotificationResponder(const std::string& replypump,
+ const LLSD& notification,
+ const LLSD& response);
+ LLNotifications & mNotifications;
};
#endif // LL_LLNOTIFICATIONSLISTENER_H