mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-11 10:12:49 +01:00
Merge branch 'ignore_from_sheet' into 'main'
feature: ignore from bottom sheet Closes #574 See merge request famedly/fluffychat!537
This commit is contained in:
commit
56646cb697
@ -9,6 +9,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'views/user_bottom_sheet_view.dart';
|
||||
import '../widgets/matrix.dart';
|
||||
|
||||
class UserBottomSheet extends StatefulWidget {
|
||||
final User user;
|
||||
@ -105,6 +106,13 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
||||
.toSegments(['rooms', roomIdResult.result]);
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
break;
|
||||
case 'ignore':
|
||||
if (await _askConfirmation()) {
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () =>
|
||||
Matrix.of(context).client.ignoreUser(widget.user.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,14 @@ class UserBottomSheetView extends StatelessWidget {
|
||||
Icons.warning_outlined,
|
||||
),
|
||||
),
|
||||
if (!client.ignoredUsers.contains(user.id))
|
||||
PopupMenuItem(
|
||||
value: 'ignore',
|
||||
child: _TextWithIcon(
|
||||
L10n.of(context).ignore,
|
||||
Icons.block,
|
||||
),
|
||||
),
|
||||
],
|
||||
onSelected: controller.participantAction,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user