@@ -22,7 +22,6 @@ use url::Url;
22
22
use matrix_sdk:: {
23
23
authentication:: matrix:: MatrixSession ,
24
24
config:: { RequestConfig , SyncSettings } ,
25
- deserialized_responses:: DisplayName ,
26
25
encryption:: verification:: { SasVerification , Verification } ,
27
26
encryption:: { BackupDownloadStrategy , EncryptionSettings } ,
28
27
event_handler:: Ctx ,
@@ -1094,30 +1093,15 @@ impl ClientWorker {
1094
1093
) ;
1095
1094
1096
1095
let _ = self . client . add_event_handler (
1097
- |ev : OriginalSyncRoomMemberEvent ,
1098
- room : MatrixRoom ,
1099
- client : Client ,
1100
- store : Ctx < AsyncProgramStore > | {
1096
+ |ev : OriginalSyncRoomMemberEvent , room : MatrixRoom , store : Ctx < AsyncProgramStore > | {
1101
1097
async move {
1102
1098
let room_id = room. room_id ( ) ;
1103
1099
let user_id = ev. state_key ;
1104
1100
1105
- let ambiguous_name = DisplayName :: new (
1106
- ev. content . displayname . as_deref ( ) . unwrap_or_else ( || user_id. as_str ( ) ) ,
1107
- ) ;
1108
- let ambiguous = client
1109
- . state_store ( )
1110
- . get_users_with_display_name ( room_id, & ambiguous_name)
1111
- . await
1112
- . map ( |users| users. len ( ) > 1 )
1113
- . unwrap_or_default ( ) ;
1114
-
1115
1101
let mut locked = store. lock ( ) . await ;
1116
1102
let info = locked. application . get_room_info ( room_id. to_owned ( ) ) ;
1117
1103
1118
- if ambiguous {
1119
- info. display_names . remove ( & user_id) ;
1120
- } else if let Some ( display) = ev. content . displayname {
1104
+ if let Some ( display) = ev. content . displayname {
1121
1105
info. display_names . insert ( user_id, display) ;
1122
1106
} else {
1123
1107
info. display_names . remove ( & user_id) ;
0 commit comments