mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-04 06:17:26 +01:00 
			
		
		
		
	feature: ignore from bottom sheet
This commit is contained in:
		
							parent
							
								
									599c0acb7f
								
							
						
					
					
						commit
						e17376c5a2
					
				@ -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;
 | 
			
		||||
@ -93,6 +94,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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user