remove options to archive chats and spaces

This commit is contained in:
ggurdin 2024-10-16 15:58:53 -04:00
parent fd0a611310
commit d1be0c664a
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 0 additions and 91 deletions

View file

@ -402,64 +402,6 @@ class ChatDetailsView extends StatelessWidget {
startOpen: false,
),
const Divider(height: 1),
if (!room.isDirectChat)
if (room.isRoomAdmin)
ListTile(
title: Text(
room.isSpace
? L10n.of(context)!.archiveSpace
: L10n.of(context)!.archive,
style: TextStyle(
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
leading: CircleAvatar(
backgroundColor:
Theme.of(context).scaffoldBackgroundColor,
foregroundColor: iconColor,
child: const Icon(
Icons.archive_outlined,
),
),
onTap: () async {
var confirmed = OkCancelResult.ok;
var shouldGo = false;
// archiveSpace has its own popup; only show if not space
if (!room.isSpace) {
confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!
.archiveRoomDescription,
);
}
if (confirmed == OkCancelResult.ok) {
if (room.isSpace) {
shouldGo = await room.archiveSpace(
context,
Matrix.of(context).client,
);
} else {
final success =
await showFutureLoadingDialog(
context: context,
future: () async {
await room.archive();
},
);
shouldGo = (success.error == null);
}
if (shouldGo) {
context.go('/rooms');
}
}
},
),
ListTile(
title: Text(
L10n.of(context)!.leave,

View file

@ -1,7 +1,6 @@
import 'dart:async';
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:fluffychat/pangea/extensions/pangea_room_extension/pangea_room_extension.dart';
import 'package:fluffychat/pangea/utils/download_chat.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -18,7 +17,6 @@ enum ChatPopupMenuActions {
leave,
search,
// #Pangea
archive,
downloadTxt,
downloadCsv,
downloadXlsx,
@ -118,25 +116,6 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
context.go('/rooms/${widget.room.id}/search');
break;
// #Pangea
case ChatPopupMenuActions.archive:
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!.archiveRoomDescription,
);
if (confirmed == OkCancelResult.ok) {
final success = await showFutureLoadingDialog(
context: context,
future: () => widget.room.archive(),
);
if (success.error == null) {
context.go('/rooms');
}
}
break;
case ChatPopupMenuActions.downloadTxt:
showFutureLoadingDialog(
context: context,
@ -246,18 +225,6 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
),
),
// #Pangea
if (!widget.room.isArchived)
if (widget.room.isRoomAdmin)
PopupMenuItem<ChatPopupMenuActions>(
value: ChatPopupMenuActions.archive,
child: Row(
children: [
const Icon(Icons.archive_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.archive),
],
),
),
PopupMenuItem<ChatPopupMenuActions>(
value: ChatPopupMenuActions.downloadTxt,
child: Row(