mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Can delete a group conversation
This commit is contained in:
		@@ -301,6 +301,10 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
 | 
			
		||||
                        )
 | 
			
		||||
                      : Icon(Icons.group, size: 30),
 | 
			
		||||
                  onChanged: (c) => _changeConversationVisibility(e, c),
 | 
			
		||||
                  trailing: IconButton(
 | 
			
		||||
                    icon: Icon(Icons.delete),
 | 
			
		||||
                    onPressed: () => _deleteConversation(e),
 | 
			
		||||
                  ),
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                return tile;
 | 
			
		||||
@@ -365,6 +369,22 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void _deleteConversation(Conversation conv) async {
 | 
			
		||||
    try {
 | 
			
		||||
      if (!await showConfirmDialog(
 | 
			
		||||
          context: context,
 | 
			
		||||
          message: tr("Do you really want to delete this conversation?")))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
      await GroupsHelper.deleteConversation(conv.id);
 | 
			
		||||
 | 
			
		||||
      _key.currentState.refresh();
 | 
			
		||||
    } catch (e, s) {
 | 
			
		||||
      logError(e, s);
 | 
			
		||||
      snack(context, tr("Failed to delete conversation!"));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Widget _buildGroupLogoArea() {
 | 
			
		||||
    return SettingsSection(
 | 
			
		||||
      title: tr("Group logo"),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user