MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / subscribe

Method subscribe

sources/api/CallbackAPI.cpp:191–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void CallbackAPI::subscribe(QJsonArray subsArr)
192{
193 // catch the all keyword and build a list of all cmds
194 if (subsArr.contains("all"))
195 {
196 subsArr = QJsonArray();
197 for (const auto& entry : _availableCommands)
198 {
199 subsArr.append(entry);
200 }
201 }
202
203 for (const QJsonValueRef entry : subsArr)
204 {
205 // config callbacks just if auth is set
206 if ((entry == "settings-update" || entry == "token-update" || entry == "imagestream-start") &&
207 !BaseAPI::isAdminAuthorized())
208 continue;
209 // silent failure if a subscribe type is not found
210 subscribeFor(entry.toString());
211 }
212}
213
214void CallbackAPI::removeSubscriptions()
215{

Callers 2

connectedMethod · 0.80

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected