mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 11:18: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.",
|
"notificationResponse": "hat dir{inGroup} geantwortet.",
|
||||||
"notificationTitleUnknownUser": "Jemand",
|
"notificationTitleUnknownUser": "Jemand",
|
||||||
"notificationCategoryMessageTitle": "Nachrichten",
|
"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}.",
|
"notificationResponse": "has responded{inGroup}.",
|
||||||
"notificationTitleUnknownUser": "Someone",
|
"notificationTitleUnknownUser": "Someone",
|
||||||
"notificationCategoryMessageTitle": "Messages",
|
"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:
|
/// In en, this message translates to:
|
||||||
/// **'Messages from other users.'**
|
/// **'Messages from other users.'**
|
||||||
String get notificationCategoryMessageDesc;
|
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
|
class _AppLocalizationsDelegate
|
||||||
|
|
|
||||||
|
|
@ -1393,4 +1393,8 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
@override
|
@override
|
||||||
String get notificationCategoryMessageDesc =>
|
String get notificationCategoryMessageDesc =>
|
||||||
'Nachrichten von anderen Benutzern.';
|
'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
|
@override
|
||||||
String get notificationCategoryMessageDesc => 'Messages from other users.';
|
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(
|
const ContactsCompanion(
|
||||||
requested: Value(false),
|
requested: Value(false),
|
||||||
accepted: Value(true),
|
accepted: Value(true),
|
||||||
|
deletedByUser: Value(false),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final contact = await twonlyDB.contactsDao
|
final contact = await twonlyDB.contactsDao
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:typed_data';
|
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/groups.pb.dart';
|
||||||
import 'package:twonly/src/model/protobuf/client/generated/messages.pbserver.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/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/services/signal/session.signal.dart';
|
||||||
import 'package:twonly/src/utils/log.dart';
|
import 'package:twonly/src/utils/log.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
|
|
@ -365,6 +367,7 @@ Future<bool> addNewHiddenContact(int contactId) async {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await createNewSignalSession(userData);
|
await createNewSignalSession(userData);
|
||||||
|
unawaited(setupNotificationWithUsers(forceContact: contactId));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/database/twonly.db.dart';
|
import 'package:twonly/src/database/twonly.db.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';
|
||||||
|
import 'package:twonly/src/views/components/alert_dialog.dart';
|
||||||
import 'package:twonly/src/views/components/context_menu.component.dart';
|
import 'package:twonly/src/views/components/context_menu.component.dart';
|
||||||
|
|
||||||
class GroupContextMenu extends StatelessWidget {
|
class GroupContextMenu extends StatelessWidget {
|
||||||
|
|
@ -75,13 +76,20 @@ class GroupContextMenu extends StatelessWidget {
|
||||||
title: context.lang.delete,
|
title: context.lang.delete,
|
||||||
icon: FontAwesomeIcons.trashCan,
|
icon: FontAwesomeIcons.trashCan,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await twonlyDB.messagesDao.deleteMessagesByGroupId(group.groupId);
|
final ok = await showAlertDialog(
|
||||||
await twonlyDB.groupsDao.updateGroup(
|
context,
|
||||||
group.groupId,
|
context.lang.deleteTitle,
|
||||||
const GroupsCompanion(
|
context.lang.groupContextMenuDeleteGroup,
|
||||||
deletedContent: Value(true),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (ok) {
|
||||||
|
await twonlyDB.messagesDao.deleteMessagesByGroupId(group.groupId);
|
||||||
|
await twonlyDB.groupsDao.updateGroup(
|
||||||
|
group.groupId,
|
||||||
|
const GroupsCompanion(
|
||||||
|
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/alert_dialog.dart';
|
||||||
import 'package:twonly/src/views/components/avatar_icon.component.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/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/components/verified_shield.dart';
|
||||||
import 'package:twonly/src/views/contact/contact_verify.view.dart';
|
import 'package:twonly/src/views/contact/contact_verify.view.dart';
|
||||||
|
|
||||||
|
|
@ -110,7 +111,6 @@ class _ContactViewState extends State<ContactView> {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
final contact = snapshot.data!;
|
final contact = snapshot.data!;
|
||||||
// final flameCounter = getFlameCounterFromContact(contact);
|
|
||||||
return ListView(
|
return ListView(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
|
|
@ -122,18 +122,19 @@ class _ContactViewState extends State<ContactView> {
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 10),
|
padding: const EdgeInsets.only(right: 10),
|
||||||
child: VerifiedShield(key: GlobalKey(), contact: contact),
|
child: VerifiedShield(
|
||||||
|
key: GlobalKey(),
|
||||||
|
contact: contact,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
getContactDisplayName(contact, maxLength: 20),
|
getContactDisplayName(contact, maxLength: 20),
|
||||||
style: const TextStyle(fontSize: 20),
|
style: const TextStyle(fontSize: 20),
|
||||||
),
|
),
|
||||||
// if (flameCounter > 0)
|
FlameCounterWidget(
|
||||||
// FlameCounterWidget(
|
contactId: contact.userId,
|
||||||
// contact,
|
prefix: true,
|
||||||
// flameCounter,
|
),
|
||||||
// prefix: true,
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (getContactDisplayName(contact) != contact.username)
|
if (getContactDisplayName(contact) != contact.username)
|
||||||
|
|
@ -166,6 +167,7 @@ class _ContactViewState extends State<ContactView> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// BetterListTile(
|
// BetterListTile(
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class _GroupViewState extends State<GroupView> {
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 10),
|
padding: const EdgeInsets.only(right: 10),
|
||||||
child: VerifiedShield(key: GlobalKey(), group: group),
|
child: VerifiedShield(key: Key(group.groupId), group: group),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
substringBy(group.groupName, 25),
|
substringBy(group.groupName, 25),
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,8 @@ class _StartNewChatView extends State<GroupCreateSelectMembersView> {
|
||||||
}
|
}
|
||||||
final user = contacts[i];
|
final user = contacts[i];
|
||||||
return UserContextMenu(
|
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,
|
contact: user,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Row(
|
title: Row(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue