diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 334de740b..da89e973f 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -3133,5 +3133,6 @@ "removeModeratorRights": "Remove moderator rights", "removeAdminRights": "Remove admin rights", "powerLevel": "Power level", - "setPowerLevelDescription": "Power levels define what a member is allowed to do in this room and usually range between 0 and 100." + "setPowerLevelDescription": "Power levels define what a member is allowed to do in this room and usually range between 0 and 100.", + "owner": "Owner" } diff --git a/lib/pages/chat_details/participant_list_item.dart b/lib/pages/chat_details/participant_list_item.dart index 04013ce50..54dcf8be3 100644 --- a/lib/pages/chat_details/participant_list_item.dart +++ b/lib/pages/chat_details/participant_list_item.dart @@ -24,7 +24,9 @@ class ParticipantListItem extends StatelessWidget { Membership.leave => L10n.of(context).leftTheChat, }; - final permissionBatch = user.powerLevel >= 100 + final permissionBatch = user.room.creatorUserIds.contains(user.id) + ? L10n.of(context).owner + : user.powerLevel >= 100 ? L10n.of(context).admin : user.powerLevel >= 50 ? L10n.of(context).moderator diff --git a/lib/widgets/member_actions_popup_menu_button.dart b/lib/widgets/member_actions_popup_menu_button.dart index 395038859..26a1bb209 100644 --- a/lib/widgets/member_actions_popup_menu_button.dart +++ b/lib/widgets/member_actions_popup_menu_button.dart @@ -34,6 +34,8 @@ Future showMemberActionsPopupMenu({ Offset.zero & overlay.size, ); + const defaultPowerLevels = {0, 50, 100, 9007199254740991}; + final action = await showMenu<_MemberActions>( context: context, position: position, @@ -124,7 +126,7 @@ Future showMemberActionsPopupMenu({ ), ], if (user.canChangeUserPowerLevel || - !{0, 50, 100}.contains(user.powerLevel)) + !defaultPowerLevels.contains(user.powerLevel)) PopupMenuItem( value: _MemberActions.setPowerLevel, enabled: user.canChangeUserPowerLevel, @@ -137,7 +139,7 @@ Future showMemberActionsPopupMenu({ ? L10n.of(context).setPowerLevel : L10n.of(context).powerLevel, ), - if (!{0, 50, 100}.contains(user.powerLevel)) + if (!defaultPowerLevels.contains(user.powerLevel)) Text(' (${user.powerLevel})'), ], ),