From 64e91cb2d4bad95d1cda4a21c766cabb2c3f031b Mon Sep 17 00:00:00 2001 From: Bastien Riviere Date: Sun, 3 Sep 2023 16:45:46 +0200 Subject: [PATCH] fix: use default topic if none is given --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a07caba..8ea1926 100644 --- a/main.go +++ b/main.go @@ -77,8 +77,11 @@ func main() { } slog.Debug("Registering bridge", "route", route, "handler", handler.Type) - // TODO: use default topic if topic == "" - bridge := bridge.NewBridge(cfg.Ntfy.Server, handler.Topic, h) + topic := handler.Topic + if topic == "" { + topic = cfg.Ntfy.DefaultTopic + } + bridge := bridge.NewBridge(cfg.Ntfy.Server, topic, h) if !auth.IsEmpty() { bridge.WithAuth(auth) }