From da24a60b0337d9c80fdab845fac3c491e50d17ef Mon Sep 17 00:00:00 2001 From: Guocork Date: Wed, 1 Jan 2025 15:51:22 +0800 Subject: [PATCH 1/2] Show valid characters. --- src/sliding_sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sliding_sync.rs b/src/sliding_sync.rs index 3bbad2db..6b81c987 100644 --- a/src/sliding_sync.rs +++ b/src/sliding_sync.rs @@ -1999,7 +1999,7 @@ fn avatar_from_room_name(room_name: &str) -> RoomPreviewAvatar { RoomPreviewAvatar::Text( room_name .graphemes(true) - .next() + .find(|g| g.chars().all(char::is_alphanumeric)) .map(ToString::to_string) .unwrap_or_default() ) From 86669f521b025b3afff9d59dad8d4275dc419316 Mon Sep 17 00:00:00 2001 From: Guocork Date: Thu, 2 Jan 2025 11:36:22 +0800 Subject: [PATCH 2/2] Skip the @ character. --- src/sliding_sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sliding_sync.rs b/src/sliding_sync.rs index 6b81c987..cba0a80f 100644 --- a/src/sliding_sync.rs +++ b/src/sliding_sync.rs @@ -1999,7 +1999,7 @@ fn avatar_from_room_name(room_name: &str) -> RoomPreviewAvatar { RoomPreviewAvatar::Text( room_name .graphemes(true) - .find(|g| g.chars().all(char::is_alphanumeric)) + .find(|&g| g != "@") .map(ToString::to_string) .unwrap_or_default() )