fix: hide ability to change bot chat settings from non-admins (#5120)
This commit is contained in:
parent
d512571792
commit
6e009c6d9e
2 changed files with 9 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:fluffychat/pangea/activity_sessions/activity_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/bot/widgets/bot_chat_settings_dialog.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
|
||||
class BotSettingsLanguageIcon extends StatelessWidget {
|
||||
final Room room;
|
||||
|
|
@ -27,10 +28,12 @@ class BotSettingsLanguageIcon extends StatelessWidget {
|
|||
langCode = langCode.split('-').first;
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(32.0),
|
||||
onTap: () => BotChatSettingsDialog.show(
|
||||
context: context,
|
||||
room: room,
|
||||
),
|
||||
onTap: room.isRoomAdmin
|
||||
? () => BotChatSettingsDialog.show(
|
||||
context: context,
|
||||
room: room,
|
||||
)
|
||||
: null,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import 'package:fluffychat/l10n/l10n.dart';
|
|||
import 'package:fluffychat/pangea/analytics_misc/level_display_name.dart';
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/bot/widgets/bot_chat_settings_dialog.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/permission_slider_dialog.dart';
|
||||
import 'adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
|
||||
|
|
@ -123,7 +124,7 @@ void showMemberActionsPopupMenu({
|
|||
],
|
||||
),
|
||||
),
|
||||
if (user.id == BotName.byEnvironment && room != null)
|
||||
if (user.id == BotName.byEnvironment && room != null && room.isRoomAdmin)
|
||||
PopupMenuItem(
|
||||
value: _MemberActions.botSettings,
|
||||
child: Row(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue