check for module attached only when enabling veto streaming, not disabling

This commit is contained in:
maliakal_d 2020-05-28 09:21:19 +02:00
parent 6189fd157a
commit d175ba0936

View File

@ -7455,23 +7455,23 @@ int set_veto(int file_des) {
// only set
if (Server_VerifyLock() == OK) {
// veto allowed only if module attached or in -nomodule mode
if (arg > 0) {
if (checkModuleFlag) {
int type_ret = checkDetectorType();
if (type_ret == -1) {
ret = FAIL;
sprintf(
mess,
"Could not enable/disable veto streaming. Could not open "
sprintf(mess, "Could not enable veto streaming. "
"Could not open "
"file to know if module attached.\n");
LOG(logERROR, (mess));
} else if (type_ret == -2) {
ret = FAIL;
sprintf(mess, "Could not enable/disable veto streaming. No "
sprintf(mess, "Could not enable veto streaming. No "
"module attached!\n");
LOG(logERROR, (mess));
} else if (type_ret == FAIL) {
ret = FAIL;
sprintf(mess, "Could not enable/disable veto streaming. Wrong "
sprintf(mess, "Could not enable veto streaming. Wrong "
"module type "
"attached!\n");
LOG(logERROR, (mess));
@ -7479,7 +7479,8 @@ int set_veto(int file_des) {
} else {
LOG(logINFOBLUE,
("In No-Module mode: Ignoring module-attached check. "
"Continuing to enable/disable veto streaming.\n"));
"Continuing to enable veto streaming.\n"));
}
}
if (ret == OK) {
setVeto(arg);