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
+1 -1
View File
@@ -863,7 +863,7 @@ func (app *appContext) sendByID(email *Message, ID ...string) error {
func (app *appContext) getAddressOrName(jfID string) string {
if dcChat, ok := app.storage.discord[jfID]; ok && dcChat.Contact && discordEnabled {
return dcChat.Username + "#" + dcChat.Discriminator
return RenderDiscordUsername(dcChat)
}
if tgChat, ok := app.storage.telegram[jfID]; ok && tgChat.Contact && telegramEnabled {
return "@" + tgChat.Username