Give the notification queue a buffer and drop events when it is full. The channel was unbuffered, so a slow or hung notification command blocked whichever UI or network callback happened to raise the event. Expand the command placeholders in a single pass. Substituting %event, then %who, then %what meant text arriving in an earlier field could contain a later placeholder and have it expanded, letting a remote user inject their own text into the command. Move the command runner behind a build tag and drop the POSIX default on Windows. The helper script it pointed at does not exist there, so the default was a command that could only fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
10 lines
143 B
Go
10 lines
143 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import "os/exec"
|
|
|
|
func runNotification(command string) {
|
|
_ = exec.Command("cmd.exe", "/C", command).Run()
|
|
}
|