mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 09:28:41 +00:00
fixes some small issues
This commit is contained in:
parent
f5dbf4a12e
commit
0dc8c87732
11 changed files with 49 additions and 18 deletions
|
|
@ -796,5 +796,6 @@
|
|||
"notificationResponse": "hat dir{inGroup} geantwortet.",
|
||||
"notificationTitleUnknownUser": "Jemand",
|
||||
"notificationCategoryMessageTitle": "Nachrichten",
|
||||
"notificationCategoryMessageDesc": "Nachrichten von anderen Benutzern."
|
||||
"notificationCategoryMessageDesc": "Nachrichten von anderen Benutzern.",
|
||||
"groupContextMenuDeleteGroup": "Dadurch werden alle Nachrichten in diesem Chat dauerhaft gelöscht."
|
||||
}
|
||||
|
|
@ -574,5 +574,6 @@
|
|||
"notificationResponse": "has responded{inGroup}.",
|
||||
"notificationTitleUnknownUser": "Someone",
|
||||
"notificationCategoryMessageTitle": "Messages",
|
||||
"notificationCategoryMessageDesc": "Messages from other users."
|
||||
"notificationCategoryMessageDesc": "Messages from other users.",
|
||||
"groupContextMenuDeleteGroup": "This will permanently delete all messages in this chat."
|
||||
}
|
||||
|
|
@ -2551,6 +2551,12 @@ abstract class AppLocalizations {
|
|||
/// In en, this message translates to:
|
||||
/// **'Messages from other users.'**
|
||||
String get notificationCategoryMessageDesc;
|
||||
|
||||
/// No description provided for @groupContextMenuDeleteGroup.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'This will permanently delete all messages in this chat.'**
|
||||
String get groupContextMenuDeleteGroup;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
|
|
|||
|
|
@ -1393,4 +1393,8 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get notificationCategoryMessageDesc =>
|
||||
'Nachrichten von anderen Benutzern.';
|
||||
|
||||
@override
|
||||
String get groupContextMenuDeleteGroup =>
|
||||
'Dadurch werden alle Nachrichten in diesem Chat dauerhaft gelöscht.';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1385,4 +1385,8 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
|
||||
@override
|
||||
String get notificationCategoryMessageDesc => 'Messages from other users.';
|
||||
|
||||
@override
|
||||
String get groupContextMenuDeleteGroup =>
|
||||
'This will permanently delete all messages in this chat.';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ Future<bool> handleContactRequest(
|
|||
const ContactsCompanion(
|
||||
requested: Value(false),
|
||||
accepted: Value(true),
|
||||
deletedByUser: Value(false),
|
||||
),
|
||||
);
|
||||
final contact = await twonlyDB.contactsDao
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
|
@ -18,6 +19,7 @@ import 'package:twonly/src/model/protobuf/api/http/http_requests.pb.dart';
|
|||
import 'package:twonly/src/model/protobuf/client/generated/groups.pb.dart';
|
||||
import 'package:twonly/src/model/protobuf/client/generated/messages.pbserver.dart';
|
||||
import 'package:twonly/src/services/api/messages.dart';
|
||||
import 'package:twonly/src/services/notifications/pushkeys.notifications.dart';
|
||||
import 'package:twonly/src/services/signal/session.signal.dart';
|
||||
import 'package:twonly/src/utils/log.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
|
|
@ -365,6 +367,7 @@ Future<bool> addNewHiddenContact(int contactId) async {
|
|||
),
|
||||
);
|
||||
await createNewSignalSession(userData);
|
||||
unawaited(setupNotificationWithUsers(forceContact: contactId));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:twonly/globals.dart';
|
|||
import 'package:twonly/src/database/twonly.db.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/views/chats/chat_messages.view.dart';
|
||||
import 'package:twonly/src/views/components/alert_dialog.dart';
|
||||
import 'package:twonly/src/views/components/context_menu.component.dart';
|
||||
|
||||
class GroupContextMenu extends StatelessWidget {
|
||||
|
|
@ -75,6 +76,12 @@ class GroupContextMenu extends StatelessWidget {
|
|||
title: context.lang.delete,
|
||||
icon: FontAwesomeIcons.trashCan,
|
||||
onTap: () async {
|
||||
final ok = await showAlertDialog(
|
||||
context,
|
||||
context.lang.deleteTitle,
|
||||
context.lang.groupContextMenuDeleteGroup,
|
||||
);
|
||||
if (ok) {
|
||||
await twonlyDB.messagesDao.deleteMessagesByGroupId(group.groupId);
|
||||
await twonlyDB.groupsDao.updateGroup(
|
||||
group.groupId,
|
||||
|
|
@ -82,6 +89,7 @@ class GroupContextMenu extends StatelessWidget {
|
|||
deletedContent: Value(true),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:twonly/src/utils/misc.dart';
|
|||
import 'package:twonly/src/views/components/alert_dialog.dart';
|
||||
import 'package:twonly/src/views/components/avatar_icon.component.dart';
|
||||
import 'package:twonly/src/views/components/better_list_title.dart';
|
||||
import 'package:twonly/src/views/components/flame.dart';
|
||||
import 'package:twonly/src/views/components/verified_shield.dart';
|
||||
import 'package:twonly/src/views/contact/contact_verify.view.dart';
|
||||
|
||||
|
|
@ -110,7 +111,6 @@ class _ContactViewState extends State<ContactView> {
|
|||
return Container();
|
||||
}
|
||||
final contact = snapshot.data!;
|
||||
// final flameCounter = getFlameCounterFromContact(contact);
|
||||
return ListView(
|
||||
children: [
|
||||
Padding(
|
||||
|
|
@ -122,18 +122,19 @@ class _ContactViewState extends State<ContactView> {
|
|||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: VerifiedShield(key: GlobalKey(), contact: contact),
|
||||
child: VerifiedShield(
|
||||
key: GlobalKey(),
|
||||
contact: contact,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
getContactDisplayName(contact, maxLength: 20),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
// if (flameCounter > 0)
|
||||
// FlameCounterWidget(
|
||||
// contact,
|
||||
// flameCounter,
|
||||
// prefix: true,
|
||||
// ),
|
||||
FlameCounterWidget(
|
||||
contactId: contact.userId,
|
||||
prefix: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (getContactDisplayName(contact) != contact.username)
|
||||
|
|
@ -166,6 +167,7 @@ class _ContactViewState extends State<ContactView> {
|
|||
},
|
||||
),
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
// BetterListTile(
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class _GroupViewState extends State<GroupView> {
|
|||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: VerifiedShield(key: GlobalKey(), group: group),
|
||||
child: VerifiedShield(key: Key(group.groupId), group: group),
|
||||
),
|
||||
Text(
|
||||
substringBy(group.groupName, 25),
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ class _StartNewChatView extends State<GroupCreateSelectMembersView> {
|
|||
}
|
||||
final user = contacts[i];
|
||||
return UserContextMenu(
|
||||
key: GlobalKey(),
|
||||
// when this is not set, then the avatar is not updated in the list when searching :/
|
||||
key: Key(user.userId.toString()),
|
||||
contact: user,
|
||||
child: ListTile(
|
||||
title: Row(
|
||||
|
|
|
|||
Loading…
Reference in a new issue