MCPcopy Create free account
hub / github.com/LUX-Core/lux / Notify

Method Notify

src/alert.cpp:259–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void CAlert::Notify(const std::string& strMessage, bool fThread)
260{
261 std::string strCmd = GetArg("-alertnotify", "");
262 if (strCmd.empty()) return;
263
264 // Alert text should be plain ascii coming from a trusted source, but to
265 // be safe we first strip anything not in safeChars, then add single quotes around
266 // the whole string before passing it to the shell:
267 std::string singleQuote("'");
268 std::string safeStatus = SanitizeString(strMessage);
269 safeStatus = singleQuote + safeStatus + singleQuote;
270 boost::replace_all(strCmd, "%s", safeStatus);
271
272 if (fThread)
273 boost::thread t(runCommand, strCmd); // thread runs free
274 else
275 runCommand(strCmd);
276}
277
278void ThreadSendAlert()
279{

Callers

nothing calls this directly

Calls 3

GetArgFunction · 0.85
SanitizeStringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected