From 758bf949db708358b1ad82297fc859b16cb3c4d2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 6 Apr 2015 19:34:36 -0700 Subject: Check for subscribed multicast groups should be able to check groups bridged behind me. --- node/Network.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index ada491a6..fa76152b 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -116,10 +116,14 @@ public: * @param mg Multicast group * @return True if this network endpoint / peer is a member */ - bool subscribedToMulticastGroup(const MulticastGroup &mg) const + bool subscribedToMulticastGroup(const MulticastGroup &mg,bool includeBridgedGroups) const { Mutex::Lock _l(_lock); - return (std::find(_myMulticastGroups.begin(),_myMulticastGroups.end(),mg) != _myMulticastGroups.end()); + if (std::find(_myMulticastGroups.begin(),_myMulticastGroups.end(),mg) != _myMulticastGroups.end()) + return true; + else if (includeBridgedGroups) + return (_multicastGroupsBehindMe.find(mg) != _multicastGroupsBehindMe.end()); + else return false; } /** -- cgit v1.2.3