From f34ba5df18cd78dfdc8ca8cb8877b09191b83edd Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 23 Oct 2023 17:59:18 +0100 Subject: [PATCH] invites: fix sending invite to @username discord format whether something was an email or not was being decided by checking for an "@", so the new format didn't work. --- api-invites.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-invites.go b/api-invites.go index 14c5f45..43713b9 100644 --- a/api-invites.go +++ b/api-invites.go @@ -192,7 +192,7 @@ func (app *appContext) GenerateInvite(gc *gin.Context) { addressValid := false discord := "" app.debug.Printf("%s: Sending invite message", invite.Code) - if discordEnabled && !strings.Contains(req.SendTo, "@") { + if discordEnabled && (!strings.Contains(req.SendTo, "@") || strings.HasPrefix(req.SendTo, "@")) { users := app.discord.GetUsers(req.SendTo) if len(users) == 0 { invite.SendTo = fmt.Sprintf("Failed: User not found: \"%s\"", req.SendTo)