Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Prefer non UserId as display names
Browse files Browse the repository at this point in the history
  • Loading branch information
mujx committed May 10, 2017
1 parent 6f06553 commit f2ce910
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ChatPage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f2ce910

Please sign in to comment.