Adapt to power level changes in room version 12

This commit is contained in:
Tobias Fella
2025-07-22 21:11:22 +02:00
committed by Tobias Fella
parent 24e43d063a
commit aa40fc84ea
3 changed files with 38 additions and 0 deletions

View File

@@ -100,6 +100,10 @@ QVariant UserListModel::data(const QModelIndex &index, int role) const
return plEvent->powerLevelForUser(memberId);
}
if (role == PowerLevelStringRole) {
if (m_currentRoom->roomCreatorHasUltimatePowerLevel() && m_currentRoom->isCreator(memberId)) {
return i18nc("@info the person that created this room", "Creator");
}
auto pl = m_currentRoom->currentState().get<RoomPowerLevelsEvent>();
// User might not in the room yet, in this case pl can be nullptr.
// e.g. When invited but user not accepted or denied the invitation.