File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
matrix-sdk-base/src/rooms Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ pub enum RoomDisplayName {
6666}
6767
6868const WHITESPACE_REGEX : & str = r"\s+" ;
69- const INVALID_SYMBOLS_REGEX : & str = r"[#,:]+" ;
69+ const INVALID_SYMBOLS_REGEX : & str = r"[#,:\{\}\\ ]+" ;
7070
7171impl RoomDisplayName {
7272 /// Transforms the current display name into the name part of a
@@ -636,7 +636,7 @@ mod tests {
636636 fn test_room_alias_from_room_display_name_removes_invalid_ascii_symbols ( ) {
637637 assert_eq ! (
638638 "roomalias" ,
639- RoomDisplayName :: Named ( "#Room,Alias:" . to_owned( ) ) . to_room_alias_name( )
639+ RoomDisplayName :: Named ( "#Room,{ Alias} :" . to_owned( ) ) . to_room_alias_name( )
640640 ) ;
641641 }
642642}
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ impl IntoRawStateEventContent for &Box<RawJsonValue> {
191191 }
192192}
193193
194- const INVALID_ROOM_ALIAS_NAME_CHARS : & str = "#,:" ;
194+ const INVALID_ROOM_ALIAS_NAME_CHARS : & str = "#,:{} \\ " ;
195195
196196/// Verifies the passed `String` matches the expected room alias format:
197197///
@@ -265,7 +265,7 @@ mod test {
265265
266266 #[ test]
267267 fn test_is_room_alias_format_valid_when_name_part_has_invalid_char_is_not_valid ( ) {
268- assert ! ( !is_room_alias_format_valid( "#alias,test :domain.org" . to_owned( ) ) )
268+ assert ! ( !is_room_alias_format_valid( "#a#lias,{t \\ est} :domain.org" . to_owned( ) ) )
269269 }
270270
271271 #[ test]
You can’t perform that action at this time.
0 commit comments