diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 8a9b29b0..5751d7f4 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -331,7 +331,11 @@ void ChatPage::updateRoomState(RoomState &room_state, const QJsonArray &events) if (display_name.isEmpty()) display_name = member.stateKey(); - TimelineViewManager::DISPLAY_NAMES.insert(member.stateKey(), display_name); + auto current_name = TimelineViewManager::DISPLAY_NAMES.value(member.stateKey()); + + if (current_name.isEmpty() || current_name == member.stateKey()) + TimelineViewManager::DISPLAY_NAMES.insert(member.stateKey(), display_name); + break; } case events::EventType::RoomPowerLevels: {