mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 07:02:12 +00:00
Fix: Issue with opening directly in chats
This commit is contained in:
parent
c77c369212
commit
5bcb3b3efe
4 changed files with 23 additions and 9 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.2.14
|
||||||
|
|
||||||
|
- Fix: Issue with opening directly in chats
|
||||||
|
- Fix: Multipe smaller issues
|
||||||
|
|
||||||
## 0.2.13
|
## 0.2.13
|
||||||
|
|
||||||
- New: Tutorial on how to use zoom.
|
- New: Tutorial on how to use zoom.
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ Future<void> setupNotificationWithUsers({
|
||||||
|
|
||||||
// HotFIX: Search for user with id 0 if not there remove all
|
// HotFIX: Search for user with id 0 if not there remove all
|
||||||
// and create new push keys with all users.
|
// and create new push keys with all users.
|
||||||
final pushUser = pushUsers.firstWhereOrNull((x) => x.userId == 0);
|
final pushUser = pushUsers.firstWhereOrNull((x) => x.userId.toInt() == 0);
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
Log.info('Clearing push keys');
|
Log.info('Clearing push keys');
|
||||||
await setPushKeys(SecureStorageKeys.receivingPushKeys, []);
|
await setPushKeys(SecureStorageKeys.receivingPushKeys, []);
|
||||||
|
|
@ -51,7 +51,7 @@ Future<void> setupNotificationWithUsers({
|
||||||
final contacts = await twonlyDB.contactsDao.getAllContacts();
|
final contacts = await twonlyDB.contactsDao.getAllContacts();
|
||||||
for (final contact in contacts) {
|
for (final contact in contacts) {
|
||||||
final pushUser = pushUsers.firstWhereOrNull(
|
final pushUser = pushUsers.firstWhereOrNull(
|
||||||
(x) => x.userId == contact.userId,
|
(x) => x.userId.toInt() == contact.userId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pushUser != null && pushUser.pushKeys.isNotEmpty) {
|
if (pushUser != null && pushUser.pushKeys.isNotEmpty) {
|
||||||
|
|
@ -124,7 +124,9 @@ Future<void> sendNewPushKey(int userId, PushKey pushKey) async {
|
||||||
Future<void> updatePushUser(Contact contact) async {
|
Future<void> updatePushUser(Contact contact) async {
|
||||||
final pushKeys = await getPushKeys(SecureStorageKeys.receivingPushKeys);
|
final pushKeys = await getPushKeys(SecureStorageKeys.receivingPushKeys);
|
||||||
|
|
||||||
final pushUser = pushKeys.firstWhereOrNull((x) => x.userId == contact.userId);
|
final pushUser = pushKeys.firstWhereOrNull(
|
||||||
|
(x) => x.userId.toInt() == contact.userId,
|
||||||
|
);
|
||||||
|
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
pushKeys.add(
|
pushKeys.add(
|
||||||
|
|
@ -148,7 +150,9 @@ Future<void> updatePushUser(Contact contact) async {
|
||||||
Future<void> handleNewPushKey(int fromUserId, int keyId, List<int> key) async {
|
Future<void> handleNewPushKey(int fromUserId, int keyId, List<int> key) async {
|
||||||
final pushKeys = await getPushKeys(SecureStorageKeys.sendingPushKeys);
|
final pushKeys = await getPushKeys(SecureStorageKeys.sendingPushKeys);
|
||||||
|
|
||||||
var pushUser = pushKeys.firstWhereOrNull((x) => x.userId == fromUserId);
|
var pushUser = pushKeys.firstWhereOrNull(
|
||||||
|
(x) => x.userId.toInt() == fromUserId,
|
||||||
|
);
|
||||||
|
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
final contact = await twonlyDB.contactsDao
|
final contact = await twonlyDB.contactsDao
|
||||||
|
|
@ -164,7 +168,7 @@ Future<void> handleNewPushKey(int fromUserId, int keyId, List<int> key) async {
|
||||||
lastMessageId: uuid.v7(),
|
lastMessageId: uuid.v7(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
pushUser = pushKeys.firstWhereOrNull((x) => x.userId == fromUserId);
|
pushUser = pushKeys.firstWhereOrNull((x) => x.userId.toInt() == fromUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
|
|
@ -187,7 +191,9 @@ Future<void> handleNewPushKey(int fromUserId, int keyId, List<int> key) async {
|
||||||
Future<void> updateLastMessageId(int fromUserId, String messageId) async {
|
Future<void> updateLastMessageId(int fromUserId, String messageId) async {
|
||||||
final pushUsers = await getPushKeys(SecureStorageKeys.receivingPushKeys);
|
final pushUsers = await getPushKeys(SecureStorageKeys.receivingPushKeys);
|
||||||
|
|
||||||
final pushUser = pushUsers.firstWhereOrNull((x) => x.userId == fromUserId);
|
final pushUser = pushUsers.firstWhereOrNull(
|
||||||
|
(x) => x.userId.toInt() == fromUserId,
|
||||||
|
);
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
unawaited(setupNotificationWithUsers());
|
unawaited(setupNotificationWithUsers());
|
||||||
return;
|
return;
|
||||||
|
|
@ -341,7 +347,9 @@ Future<Uint8List?> encryptPushNotification(
|
||||||
var key = 'InsecureOnlyUsedForAddingContact'.codeUnits;
|
var key = 'InsecureOnlyUsedForAddingContact'.codeUnits;
|
||||||
var keyId = 0;
|
var keyId = 0;
|
||||||
|
|
||||||
final pushUser = pushKeys.firstWhereOrNull((x) => x.userId == toUserId);
|
final pushUser = pushKeys.firstWhereOrNull(
|
||||||
|
(x) => x.userId.toInt() == toUserId,
|
||||||
|
);
|
||||||
|
|
||||||
if (pushUser == null) {
|
if (pushUser == null) {
|
||||||
// user does not have send any push keys
|
// user does not have send any push keys
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class MainCameraController {
|
||||||
CameraController? cameraController;
|
CameraController? cameraController;
|
||||||
ScreenshotController screenshotController = ScreenshotController();
|
ScreenshotController screenshotController = ScreenshotController();
|
||||||
SelectedCameraDetails selectedCameraDetails = SelectedCameraDetails();
|
SelectedCameraDetails selectedCameraDetails = SelectedCameraDetails();
|
||||||
bool initCameraStarted = true;
|
bool initCameraStarted = false;
|
||||||
Map<int, ScannedVerifiedContact> contactsVerified = {};
|
Map<int, ScannedVerifiedContact> contactsVerified = {};
|
||||||
Map<int, ScannedNewProfile> scannedNewProfiles = {};
|
Map<int, ScannedNewProfile> scannedNewProfiles = {};
|
||||||
final Set<String> _handledProfileLinks = {};
|
final Set<String> _handledProfileLinks = {};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.2.13+122
|
version: 0.2.14+123
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.0
|
sdk: ^3.11.0
|
||||||
|
|
@ -185,6 +185,7 @@ dev_dependencies:
|
||||||
in_app_purchase_platform_interface: ^1.4.0
|
in_app_purchase_platform_interface: ^1.4.0
|
||||||
integration_test:
|
integration_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
workmanager_platform_interface: any
|
||||||
|
|
||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
android: true
|
android: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue