Skip to content

Commit 51e2acd

Browse files
committed
Don't try to hide ambiguous usernames
1 parent e3090e5 commit 51e2acd

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/worker.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use url::Url;
2222
use matrix_sdk::{
2323
authentication::matrix::MatrixSession,
2424
config::{RequestConfig, SyncSettings},
25-
deserialized_responses::DisplayName,
2625
encryption::verification::{SasVerification, Verification},
2726
encryption::{BackupDownloadStrategy, EncryptionSettings},
2827
event_handler::Ctx,
@@ -1094,30 +1093,15 @@ impl ClientWorker {
10941093
);
10951094

10961095
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>| {
11011097
async move {
11021098
let room_id = room.room_id();
11031099
let user_id = ev.state_key;
11041100

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-
11151101
let mut locked = store.lock().await;
11161102
let info = locked.application.get_room_info(room_id.to_owned());
11171103

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 {
11211105
info.display_names.insert(user_id, display);
11221106
} else {
11231107
info.display_names.remove(&user_id);

0 commit comments

Comments
 (0)