Fixed autopush removing themselves when a new push comes in

This commit is contained in:
Thulinma 2017-11-09 14:07:20 +01:00
parent 47ed55c637
commit db410e10f4

View file

@ -318,7 +318,7 @@ namespace Controller{
/// Starts all configured auto pushes for the given stream. /// Starts all configured auto pushes for the given stream.
void doAutoPush(std::string &streamname){ void doAutoPush(std::string &streamname){
jsonForEach(Controller::Storage["autopushes"], it){ jsonForEach(Controller::Storage["autopushes"], it){
if (it->size() > 2 || (*it)[2u].asInt() < Util::epoch()){continue;} if (it->size() > 2 && (*it)[2u].asInt() < Util::epoch()){continue;}
const std::string &pStr = (*it)[0u].asStringRef(); const std::string &pStr = (*it)[0u].asStringRef();
if (pStr == streamname || (*pStr.rbegin() == '+' && streamname.substr(0, pStr.size()) == pStr)){ if (pStr == streamname || (*pStr.rbegin() == '+' && streamname.substr(0, pStr.size()) == pStr)){
std::string stream = streamname; std::string stream = streamname;