From 6a278bc2cfaa212c9f4477ebb92787eb18d64873 Mon Sep 17 00:00:00 2001 From: Merlin <158784988+merlinz01@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:27:16 -0500 Subject: [PATCH] Add support for topic in Zulip notifications and truncate long topics Subjects over 60 characters long, such as the test notification, are rejected by shoutrrr. This truncates the subject to the max length. Users may want all Scrutiny notifications to be sent to a particular topic rather than whatever Scrutiny happens to decide. --- webapp/backend/pkg/notify/notify.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webapp/backend/pkg/notify/notify.go b/webapp/backend/pkg/notify/notify.go index 885965c..9220a3c 100644 --- a/webapp/backend/pkg/notify/notify.go +++ b/webapp/backend/pkg/notify/notify.go @@ -424,6 +424,17 @@ func (n *Notify) GenShoutrrrNotificationParams(shoutrrrUrl string) (string, *sho case "telegram": (*params)["title"] = subject case "zulip": + query := serviceURL.Query() + urlTopic := query["topic"] + delete(query, "topic") + if len(urlTopic) > 0 && urlTopic[len(urlTopic)-1] != "" { + subject = urlTopic[len(urlTopic)-1] + } + subjectRunes := []rune(subject) + if len(subjectRunes) > 60 { + n.Logger.Warningf("Zulip notification subject too long (%d characters), truncating to 60 characters", len(subjectRunes)) + subject = string(subjectRunes[:60]) + } (*params)["topic"] = subject }