1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can delete a group conversation

This commit is contained in:
2021-04-06 17:46:05 +02:00
parent 5773981750
commit 22f27a24de
2 changed files with 28 additions and 0 deletions

View File

@ -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"),