mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 17:48:40 +00:00
make it possible to clear retransmission
This commit is contained in:
parent
0845701e16
commit
7e680c99a3
3 changed files with 26 additions and 2 deletions
|
|
@ -92,6 +92,10 @@ class MessageRetransmissionDao extends DatabaseAccessor<TwonlyDatabase>
|
||||||
.go();
|
.go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> clearRetransmissionTable() {
|
||||||
|
return delete(messageRetransmissions).go();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> deleteRetransmissionByMessageId(int messageId) {
|
Future<void> deleteRetransmissionByMessageId(int messageId) {
|
||||||
return (delete(messageRetransmissions)
|
return (delete(messageRetransmissions)
|
||||||
..where((t) => t.messageId.equals(messageId)))
|
..where((t) => t.messageId.equals(messageId)))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/views/chats/chat_messages.view.dart';
|
import 'package:twonly/src/views/chats/chat_messages.view.dart';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/utils/storage.dart';
|
import 'package:twonly/src/utils/storage.dart';
|
||||||
|
import 'package:twonly/src/views/components/alert_dialog.dart';
|
||||||
import 'package:twonly/src/views/settings/help/contact_us.view.dart';
|
import 'package:twonly/src/views/settings/help/contact_us.view.dart';
|
||||||
import 'package:twonly/src/views/settings/help/credits.view.dart';
|
import 'package:twonly/src/views/settings/help/credits.view.dart';
|
||||||
import 'package:twonly/src/views/settings/help/diagnostics.view.dart';
|
import 'package:twonly/src/views/settings/help/diagnostics.view.dart';
|
||||||
|
|
@ -89,6 +91,14 @@ class HelpView extends StatelessWidget {
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: const Text("Open Source"),
|
||||||
|
onTap: () {
|
||||||
|
launchUrl(Uri.parse('https://github.com/twonlyapp/twonly-app'));
|
||||||
|
},
|
||||||
|
trailing:
|
||||||
|
const FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(context.lang.settingsHelpImprint),
|
title: Text(context.lang.settingsHelpImprint),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
@ -105,7 +115,18 @@ class HelpView extends StatelessWidget {
|
||||||
trailing:
|
trailing:
|
||||||
const FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15),
|
const FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15),
|
||||||
),
|
),
|
||||||
const ListTile(
|
ListTile(
|
||||||
|
onLongPress: () async {
|
||||||
|
bool? okay = await showAlertDialog(
|
||||||
|
context,
|
||||||
|
"Delete Retransmission messages",
|
||||||
|
"Only do this if you know what you are doing :)",
|
||||||
|
);
|
||||||
|
if (okay == true) {
|
||||||
|
await twonlyDB.messageRetransmissionDao
|
||||||
|
.clearRetransmissionTable();
|
||||||
|
}
|
||||||
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
'Copyright twonly',
|
'Copyright twonly',
|
||||||
style: TextStyle(color: Colors.grey, fontSize: 13),
|
style: TextStyle(color: Colors.grey, fontSize: 13),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue