From 5249366aa3d753c07e3bc4da19c696bbedeeedb6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 3 Apr 2026 20:00:19 +0200 Subject: [PATCH] refactor(models): use shared GetMailDomain in getThreadID --- pkg/models/notifications.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/models/notifications.go b/pkg/models/notifications.go index 2601f5adc..252f754fb 100644 --- a/pkg/models/notifications.go +++ b/pkg/models/notifications.go @@ -18,7 +18,6 @@ package models import ( "fmt" - "net/url" "sort" "strconv" "time" @@ -26,6 +25,7 @@ import ( "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/i18n" + "code.vikunja.io/api/pkg/mail" "code.vikunja.io/api/pkg/modules/avatar" "code.vikunja.io/api/pkg/notifications" "code.vikunja.io/api/pkg/user" @@ -44,14 +44,7 @@ func getDoerAvatarDataURI(doer *user.User) string { // getThreadID generates a Message-ID format thread ID for a task func getThreadID(taskID int64) string { - domain := "vikunja" - publicURL := config.ServicePublicURL.GetString() - if publicURL != "" { - if parsedURL, err := url.Parse(publicURL); err == nil && parsedURL.Hostname() != "" { - domain = parsedURL.Hostname() - } - } - return fmt.Sprintf("", taskID, domain) + return fmt.Sprintf("", taskID, mail.GetMailDomain()) } // ReminderDueNotification represents a ReminderDueNotification notification