fix: Archive
This commit is contained in:
parent
8af9af10ae
commit
eac784e33b
11 changed files with 89 additions and 53 deletions
|
|
@ -630,6 +630,7 @@ class ChatController extends State<Chat> {
|
|||
}
|
||||
|
||||
bool get canRedactSelectedEvents {
|
||||
if (isArchived) return false;
|
||||
final clients = matrix!.currentBundle;
|
||||
for (final event in selectedEvents) {
|
||||
if (event.canRedact == false &&
|
||||
|
|
@ -639,7 +640,9 @@ class ChatController extends State<Chat> {
|
|||
}
|
||||
|
||||
bool get canEditSelectedEvents {
|
||||
if (selectedEvents.length != 1 || !selectedEvents.first.status.isSent) {
|
||||
if (isArchived ||
|
||||
selectedEvents.length != 1 ||
|
||||
!selectedEvents.first.status.isSent) {
|
||||
return false;
|
||||
}
|
||||
return currentRoomBundle
|
||||
|
|
@ -757,6 +760,15 @@ class ChatController extends State<Chat> {
|
|||
return sendEmojiAction(emoji.emoji);
|
||||
}
|
||||
|
||||
void forgetRoom() async {
|
||||
final result = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: room!.forget,
|
||||
);
|
||||
if (result.error != null) return;
|
||||
VRouter.of(context).to('/archive');
|
||||
}
|
||||
|
||||
void typeEmoji(Emoji? emoji) {
|
||||
if (emoji == null) return;
|
||||
final text = sendController.text;
|
||||
|
|
@ -1008,6 +1020,9 @@ class ChatController extends State<Chat> {
|
|||
setState(() => inputText = text);
|
||||
}
|
||||
|
||||
bool get isArchived =>
|
||||
{Membership.leave, Membership.ban}.contains(room?.membership);
|
||||
|
||||
void showEventInfo([Event? event]) =>
|
||||
(event ?? selectedEvents.single).showInfoDialog(context);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue