8ea907066b
Remove all deprecated Shoutrrr integration artifacts and dead legacy fallback code from the notification subsystem. - Remove legacySendFunc field, ErrLegacyFallbackDisabled error, and legacyFallbackInvocationError() from notification service - Delete ShouldUseLegacyFallback() from notification router; simplify ShouldUseNotify() by removing now-dead providerEngine parameter - Remove EngineLegacy engine constant; EngineNotifyV1 is the sole engine - Remove legacy.fallback_enabled feature flag, retiredLegacyFallbackEnvAliases, and parseFlagBool/resolveRetiredLegacyFallback helpers from flags handler - Remove orphaned EmailRecipients field from NotificationConfig model - Delete feature_flags_coverage_v2_test.go (tested only the retired flag path) - Delete security_notifications_test.go.archived (stale archived file) - Move FIREFOX_E2E_FIXES_SUMMARY.md to docs/implementation/ - Remove root-level scan artifacts tracked in error; add gitignore patterns to prevent future tracking of trivy-report.json and related outputs - Update ARCHITECTURE.instructions.md: Notifications row Shoutrrr → Notify No functional changes to active notification dispatch or mail delivery.
28 lines
525 B
Go
28 lines
525 B
Go
package notifications
|
|
|
|
import "strings"
|
|
|
|
// NOTE: used only in tests
|
|
type Router struct{}
|
|
|
|
func NewRouter() *Router {
|
|
return &Router{}
|
|
}
|
|
|
|
func (r *Router) ShouldUseNotify(providerType string, flags map[string]bool) bool {
|
|
if !flags[FlagNotifyEngineEnabled] {
|
|
return false
|
|
}
|
|
|
|
switch strings.ToLower(providerType) {
|
|
case "discord":
|
|
return flags[FlagDiscordServiceEnabled]
|
|
case "gotify":
|
|
return flags[FlagGotifyServiceEnabled]
|
|
case "webhook":
|
|
return flags[FlagWebhookServiceEnabled]
|
|
default:
|
|
return false
|
|
}
|
|
}
|