Files
Charon/backend/internal/notifications/router.go
T
2026-03-04 18:34:49 +00:00

38 lines
899 B
Go

package notifications
import "strings"
type Router struct{}
func NewRouter() *Router {
return &Router{}
}
func (r *Router) ShouldUseNotify(providerType, providerEngine string, flags map[string]bool) bool {
if !flags[FlagNotifyEngineEnabled] {
return false
}
if strings.EqualFold(providerEngine, EngineLegacy) {
return false
}
switch strings.ToLower(providerType) {
case "discord":
return flags[FlagDiscordServiceEnabled]
case "gotify":
return flags[FlagGotifyServiceEnabled]
case "webhook":
return flags[FlagWebhookServiceEnabled]
default:
return false
}
}
func (r *Router) ShouldUseLegacyFallback(flags map[string]bool) bool {
// Hard-disabled: Legacy fallback has been permanently removed.
// This function exists only for interface compatibility and always returns false.
_ = flags // Explicitly ignore flags to prevent accidental re-introduction
return false
}