fix(trigger): only send notifier when push=1/true; otherwise just return summary

This commit is contained in:
Thomas Cravey 2025-08-16 20:59:23 -05:00
parent 7eea39310a
commit cbd798dfd5

View file

@ -155,7 +155,9 @@ func (s *Server) handleTrigger(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("summarizer error")) _, _ = w.Write([]byte("summarizer error"))
return return
} }
if s.Notifier != nil { // Only push if explicitly requested
pushFlag := strings.EqualFold(r.URL.Query().Get("push"), "1") || strings.EqualFold(r.URL.Query().Get("push"), "true")
if pushFlag && s.Notifier != nil {
title := fmt.Sprintf("IRC digest %s (%s)", channel, window) title := fmt.Sprintf("IRC digest %s (%s)", channel, window)
_ = s.Notifier.Notify(ctx, title, summary) _ = s.Notifier.Notify(ctx, title, summary)
if s.Metrics != nil { if s.Metrics != nil {