summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llnotifications.cpp1
-rwxr-xr-xindra/llui/llnotifications.h8
-rw-r--r--indra/llui/llnotificationslistener.cpp16
3 files changed, 19 insertions, 6 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 5c288c3f03..99641ae104 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1189,6 +1189,7 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
}
else
{
+ mParents.push_back(channel_name);
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
}
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 6ac4a98806..39426d9a89 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -88,6 +88,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/type_traits.hpp>
#include <boost/signals2.hpp>
+#include <boost/range.hpp>
#include "llevents.h"
#include "llfunctorregistry.h"
@@ -839,6 +840,11 @@ public:
typedef LLNotificationSet::iterator Iterator;
std::string getName() const { return mName; }
+ typedef std::vector<std::string>::const_iterator parents_iter;
+ boost::iterator_range<parents_iter> getParents() const
+ {
+ return boost::iterator_range<parents_iter>(mParents);
+ }
void connectToChannel(const std::string& channel_name);
@@ -853,7 +859,7 @@ public:
private:
std::string mName;
- std::string mParent;
+ std::vector<std::string> mParents;
};
// An interface class to provide a clean linker seam to the LLNotifications class.
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index 3bbeb3a778..b6a32a0e78 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -32,6 +32,7 @@
#include "llnotificationtemplate.h"
#include "llsd.h"
#include "llui.h"
+#include <boost/foreach.hpp>
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@@ -121,13 +122,18 @@ void LLNotificationsListener::listChannels(const LLSD& params) const
{
LLReqID reqID(params);
LLSD response(reqID.makeResponse());
- for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
- cmend(mNotifications.mChannels.end());
+ for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()),
+ cmend(LLNotificationChannel::endInstances());
cmi != cmend; ++cmi)
{
- LLSD channelInfo;
- channelInfo["parent"] = cmi->second->getParentChannelName();
- response[cmi->first] = channelInfo;
+ LLSD channelInfo, parents;
+ BOOST_FOREACH(const std::string& parent, cmi->getParents())
+ {
+ parents.append(parent);
+ }
+ channelInfo["parents"] = parents;
+ channelInfo["parent"] = parents.size()? parents[0] : "";
+ response[cmi->getName()] = channelInfo;
}
LLEventPumps::instance().obtain(params["reply"]).post(response);
}