Add dynamic node info restrictedTG

The JSON restrictedTG boolean node info variable is set to true if the
talk group have an ALLOW specification.
This commit is contained in:
Tobias Blomberg 2022-03-26 13:03:31 +01:00
parent 6f65df27bc
commit 5f8aa8b967
4 changed files with 15 additions and 3 deletions

View File

@ -656,6 +656,7 @@ void Reflector::httpRequestReceived(Async::HttpServerConnection *con,
tg = 0;
}
node["tg"] = tg;
node["restrictedTG"] = TGHandler::instance()->isRestricted(tg);
Json::Value tgs = Json::Value(Json::arrayValue);
const std::set<uint32_t>& monitored_tgs = client->monitoredTGs();
for (std::set<uint32_t>::const_iterator mtg_it=monitored_tgs.begin();

View File

@ -287,7 +287,7 @@ bool TGHandler::allowTgSelection(ReflectorClient *client, uint32_t tg)
} /* TGHandler::allowTgSelection */
bool TGHandler::showActivity(uint32_t tg)
bool TGHandler::showActivity(uint32_t tg) const
{
std::ostringstream ss;
ss << "TG#" << tg;
@ -297,6 +297,15 @@ bool TGHandler::showActivity(uint32_t tg)
} /* TGHandler::showActivity */
bool TGHandler::isRestricted(uint32_t tg) const
{
std::ostringstream ss;
ss << "TG#" << tg;
std::string allow;
return m_cfg->getValue(ss.str(), "ALLOW", allow);
} /* TGHandler::isRestricted */
/****************************************************************************
*
* Protected member functions

View File

@ -160,7 +160,9 @@ class TGHandler : public sigc::trackable
bool allowTgSelection(ReflectorClient *client, uint32_t tg);
bool showActivity(uint32_t tg);
bool showActivity(uint32_t tg) const;
bool isRestricted(uint32_t tg) const;
sigc::signal<void, uint32_t,
ReflectorClient*, ReflectorClient*> talkerUpdated;

View File

@ -37,4 +37,4 @@ DEVCAL=1.0.2.99.6
SVXSERVER=0.0.6
# Version for SvxReflector
SVXREFLECTOR=1.99.12
SVXREFLECTOR=1.99.13