discord: proper support for discriminator-less

names with no discriminator are shown as @username, and search works
with the @ too. Also bumped go version to 1.20, since it was stuck on
1.16 and i felt like trying generics (in an ugly way).
This commit is contained in:
Harvey Tindall
2023-06-12 16:32:40 +01:00
parent 6564df8082
commit 48403ce940
6 changed files with 97 additions and 181 deletions
+2 -1
View File
@@ -916,7 +916,8 @@ func (app *appContext) GetUsers(gc *gin.Context) {
user.NotifyThroughMatrix = mxUser.Contact
}
if dcUser, ok := app.storage.discord[jfUser.ID]; ok {
user.Discord = dcUser.Username + "#" + dcUser.Discriminator
user.Discord = RenderDiscordUsername(dcUser)
// user.Discord = dcUser.Username + "#" + dcUser.Discriminator
user.DiscordID = dcUser.ID
user.NotifyThroughDiscord = dcUser.Contact
}