Allow detector filters to send emails without a monitor global detector setting of sending email being sent.
parent
f178d2121c
commit
6b7a17e4ce
|
@ -2513,7 +2513,6 @@ module.exports = function(s,config,lang){
|
|||
"description": "The amount of time until a trigger is allowed to send another email with motion details and another image.",
|
||||
"default": "10",
|
||||
"example": "",
|
||||
"form-group-class": "h_det_email_input h_det_email_1",
|
||||
"form-group-class-pre-layer": "h_det_input h_det_1",
|
||||
"possible": ""
|
||||
},
|
||||
|
|
|
@ -183,15 +183,15 @@ module.exports = function(s,config,lang){
|
|||
indifference : false,
|
||||
countObjects : true
|
||||
}
|
||||
s.onEventTriggerBeforeFilterExtensions.forEach(function(extender){
|
||||
extender(d,filter)
|
||||
})
|
||||
var detailString = JSON.stringify(d.details);
|
||||
if(!s.group[d.ke]||!s.group[d.ke].activeMonitors[d.id]){
|
||||
return s.systemLog(lang['No Monitor Found, Ignoring Request'])
|
||||
}
|
||||
d.mon=s.group[d.ke].rawMonitorConfigurations[d.id];
|
||||
var currentConfig = s.group[d.ke].rawMonitorConfigurations[d.id].details
|
||||
s.onEventTriggerBeforeFilterExtensions.forEach(function(extender){
|
||||
extender(d,filter)
|
||||
})
|
||||
var hasMatrices = (d.details.matrices && d.details.matrices.length > 0)
|
||||
//read filters
|
||||
if(
|
||||
|
|
|
@ -275,10 +275,14 @@ module.exports = function(s,config,lang){
|
|||
}
|
||||
}
|
||||
var onEventTriggerBeforeFilterForEmail = function(d,filter){
|
||||
filter.mail = true
|
||||
if(d.mon.details.detector_mail === '1'){
|
||||
filter.mail = true
|
||||
}else{
|
||||
filter.mail = false
|
||||
}
|
||||
}
|
||||
var onEventTriggerForEmail = function(d,filter){
|
||||
if(filter.mail && config.mail && !s.group[d.ke].activeMonitors[d.id].detector_mail && d.mon.details.detector_mail === '1'){
|
||||
if(filter.mail && config.mail && !s.group[d.ke].activeMonitors[d.id].detector_mail){
|
||||
s.sqlQuery('SELECT mail FROM Users WHERE ke=? AND details NOT LIKE ?',[d.ke,'%"sub"%'],function(err,r){
|
||||
r=r[0];
|
||||
var detector_mail_timeout
|
||||
|
|
Loading…
Reference in New Issue