Improve firewall core logic, add prompt support via notifications
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user