chore: Follow up chat settings
This commit is contained in:
parent
e14173688a
commit
f36d5f8a89
4 changed files with 22 additions and 14 deletions
|
|
@ -750,11 +750,7 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"editChatPermissions": "Edit chat permissions",
|
"chatPermissions": "Chat permissions",
|
||||||
"@editChatPermissions": {
|
|
||||||
"type": "text",
|
|
||||||
"placeholders": {}
|
|
||||||
},
|
|
||||||
"editDisplayname": "Edit displayname",
|
"editDisplayname": "Edit displayname",
|
||||||
"@editDisplayname": {
|
"@editDisplayname": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
|
|
||||||
|
|
@ -298,14 +298,18 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
title: Text(
|
title: Text(
|
||||||
L10n.of(context)!.whoIsAllowedToJoinThisGroup,
|
L10n.of(context)!.whoIsAllowedToJoinThisGroup,
|
||||||
),
|
),
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
trailing: room.canChangeJoinRules
|
||||||
|
? const Icon(Icons.chevron_right_outlined)
|
||||||
|
: null,
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
room.joinRules?.getLocalizedString(
|
room.joinRules?.getLocalizedString(
|
||||||
MatrixLocals(L10n.of(context)!),
|
MatrixLocals(L10n.of(context)!),
|
||||||
) ??
|
) ??
|
||||||
L10n.of(context)!.none,
|
L10n.of(context)!.none,
|
||||||
),
|
),
|
||||||
onTap: controller.setJoinRules,
|
onTap: room.canChangeJoinRules
|
||||||
|
? controller.setJoinRules
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
if (!room.isDirectChat)
|
if (!room.isDirectChat)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
@ -315,7 +319,9 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
foregroundColor: iconColor,
|
foregroundColor: iconColor,
|
||||||
child: const Icon(Icons.visibility_outlined),
|
child: const Icon(Icons.visibility_outlined),
|
||||||
),
|
),
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
trailing: room.canChangeHistoryVisibility
|
||||||
|
? const Icon(Icons.chevron_right_outlined)
|
||||||
|
: null,
|
||||||
title: Text(
|
title: Text(
|
||||||
L10n.of(context)!.visibilityOfTheChatHistory,
|
L10n.of(context)!.visibilityOfTheChatHistory,
|
||||||
),
|
),
|
||||||
|
|
@ -325,7 +331,9 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
) ??
|
) ??
|
||||||
L10n.of(context)!.none,
|
L10n.of(context)!.none,
|
||||||
),
|
),
|
||||||
onTap: controller.setHistoryVisibility,
|
onTap: room.canChangeHistoryVisibility
|
||||||
|
? controller.setHistoryVisibility
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
if (room.joinRules == JoinRules.public)
|
if (room.joinRules == JoinRules.public)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
@ -337,7 +345,9 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
Icons.person_add_alt_1_outlined,
|
Icons.person_add_alt_1_outlined,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
trailing: room.canChangeGuestAccess
|
||||||
|
? const Icon(Icons.chevron_right_outlined)
|
||||||
|
: null,
|
||||||
title: Text(
|
title: Text(
|
||||||
L10n.of(context)!.areGuestsAllowedToJoin,
|
L10n.of(context)!.areGuestsAllowedToJoin,
|
||||||
),
|
),
|
||||||
|
|
@ -346,11 +356,13 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
MatrixLocals(L10n.of(context)!),
|
MatrixLocals(L10n.of(context)!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: controller.setGuestAccess,
|
onTap: room.canChangeGuestAccess
|
||||||
|
? controller.setGuestAccess
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
if (!room.isDirectChat)
|
if (!room.isDirectChat)
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10n.of(context)!.editChatPermissions),
|
title: Text(L10n.of(context)!.chatPermissions),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
L10n.of(context)!.whoCanPerformWhichAction,
|
L10n.of(context)!.whoCanPerformWhichAction,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: const Center(child: BackButton()),
|
leading: const Center(child: BackButton()),
|
||||||
title: Text(L10n.of(context)!.editChatPermissions),
|
title: Text(L10n.of(context)!.chatPermissions),
|
||||||
),
|
),
|
||||||
body: MaxWidthBody(
|
body: MaxWidthBody(
|
||||||
child: StreamBuilder(
|
child: StreamBuilder(
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class PermissionsListTile extends StatelessWidget {
|
||||||
case EventTypes.RoomName:
|
case EventTypes.RoomName:
|
||||||
return L10n.of(context)!.changeTheNameOfTheGroup;
|
return L10n.of(context)!.changeTheNameOfTheGroup;
|
||||||
case EventTypes.RoomPowerLevels:
|
case EventTypes.RoomPowerLevels:
|
||||||
return L10n.of(context)!.editChatPermissions;
|
return L10n.of(context)!.chatPermissions;
|
||||||
case EventTypes.HistoryVisibility:
|
case EventTypes.HistoryVisibility:
|
||||||
return L10n.of(context)!.visibilityOfTheChatHistory;
|
return L10n.of(context)!.visibilityOfTheChatHistory;
|
||||||
case EventTypes.RoomCanonicalAlias:
|
case EventTypes.RoomCanonicalAlias:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue