From 20bb4085d2f1d2049571014d5b04c80a640b15a8 Mon Sep 17 00:00:00 2001 From: John Wregglesworth Date: Wed, 12 Jun 2024 13:13:42 -0700 Subject: [PATCH] Make sure the user suffix is appended correctly --- internal/internal.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/internal.go b/internal/internal.go index 7222bfe..f66bde5 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -48,6 +48,11 @@ type AppConfiguration struct { func (a *App) FixUsername(username string) string { if !strings.HasSuffix(username, a.userSuffix) { + // Only add a @ if the configured user suffix doesn't already + // start with one. + if strings.HasPrefix("@", a.userSuffix) { + return fmt.Sprintf("%s%s", username, a.userSuffix) + } return fmt.Sprintf("%s@%s", username, a.userSuffix) } return username