Improve firewall core logic, add prompt support via notifications

This commit is contained in:
Daniel
2019-03-08 23:15:36 +01:00
parent d596bd07ca
commit 5f21f7bc60
5 changed files with 372 additions and 128 deletions

View File

@@ -51,6 +51,7 @@ func (comm *Communication) ResetVerdict() {
defer comm.Unlock()
comm.Verdict = VerdictUndecided
comm.Reason = ""
}
// GetVerdict returns the current verdict.
@@ -99,6 +100,17 @@ func (comm *Communication) UpdateVerdict(newVerdict Verdict) {
}
}
// SetReason sets/replaces a human readable string as to why a certain verdict was set in regard to this communication.
func (comm *Communication) SetReason(reason string) {
if reason == "" {
return
}
comm.Lock()
defer comm.Unlock()
comm.Reason = reason
}
// AddReason adds a human readable string as to why a certain verdict was set in regard to this communication.
func (comm *Communication) AddReason(reason string) {
if reason == "" {