multiple bug fixes

This commit is contained in:
otsmr 2025-06-07 15:38:00 +02:00
parent 23ae553203
commit 5243fd609f
7 changed files with 39 additions and 34 deletions

View file

@ -294,8 +294,12 @@ class ApiService {
} }
if (res.error == ErrorCode.UserIdNotFound && contactId != null) { if (res.error == ErrorCode.UserIdNotFound && contactId != null) {
Log.error("Contact deleted their account $contactId."); Log.error("Contact deleted their account $contactId.");
await twonlyDB.contactsDao await twonlyDB.contactsDao.updateContact(
.updateContact(contactId, ContactsCompanion(deleted: Value(true))); contactId,
ContactsCompanion(
deleted: Value(true),
),
);
} }
} }
return res; return res;

View file

@ -77,7 +77,8 @@ Future<bool> isAllowedToDownload(bool isVideo) async {
Future startDownloadMedia(Message message, bool force, Future startDownloadMedia(Message message, bool force,
{int retryCounter = 0}) async { {int retryCounter = 0}) async {
if (message.contentJson == null) return; if (message.contentJson == null) return;
if (downloadStartedForMediaReceived[message.messageId] != null) { if (downloadStartedForMediaReceived[message.messageId] != null &&
retryCounter == 0) {
DateTime started = downloadStartedForMediaReceived[message.messageId]!; DateTime started = downloadStartedForMediaReceived[message.messageId]!;
Duration elapsed = DateTime.now().difference(started); Duration elapsed = DateTime.now().difference(started);
if (elapsed <= Duration(seconds: 60)) { if (elapsed <= Duration(seconds: 60)) {

View file

@ -264,7 +264,7 @@ Future<client.Response> handleNewMessage(int fromUserId, Uint8List body) async {
} }
await encryptAndSendMessageAsync( await encryptAndSendMessageAsync(
message.messageId!, null,
fromUserId, fromUserId,
MessageJson( MessageJson(
kind: MessageKind.ack, kind: MessageKind.ack,

View file

@ -1,6 +1,7 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:twonly/globals.dart'; import 'package:twonly/globals.dart';
import 'package:twonly/src/utils/log.dart';
import 'package:twonly/src/views/camera/image_editor/layers/filter_layer.dart'; import 'package:twonly/src/views/camera/image_editor/layers/filter_layer.dart';
import 'package:twonly/src/views/camera/image_editor/layers/filters/datetime_filter.dart'; import 'package:twonly/src/views/camera/image_editor/layers/filters/datetime_filter.dart';
import 'package:twonly/src/model/protobuf/api/server_to_client.pb.dart'; import 'package:twonly/src/model/protobuf/api/server_to_client.pb.dart';
@ -140,8 +141,9 @@ Future<List<Sticker>> getStickerIndex() async {
return res; return res;
} }
} }
final response = try {
await http.get(Uri.parse('https://twonly.eu/api/sticker/stickers.json')); final response = await http
.get(Uri.parse('https://twonly.eu/api/sticker/stickers.json'));
if (response.statusCode == 200) { if (response.statusCode == 200) {
await indexFile.writeAsString(response.body); await indexFile.writeAsString(response.body);
List<dynamic> jsonList = json.decode(response.body); List<dynamic> jsonList = json.decode(response.body);
@ -149,4 +151,8 @@ Future<List<Sticker>> getStickerIndex() async {
} else { } else {
return res; return res;
} }
} catch (e) {
Log.error("$e");
return res;
}
} }

View file

@ -22,10 +22,12 @@ class _VideoPlayerWrapperState extends State<VideoPlayerWrapper> {
super.initState(); super.initState();
_controller = VideoPlayerController.file(widget.videoPath) _controller = VideoPlayerController.file(widget.videoPath)
..initialize().then((_) { ..initialize().then((_) {
if (context.mounted) {
setState(() { setState(() {
_controller.setLooping(true); _controller.setLooping(true);
_controller.play(); _controller.play();
}); });
}
}); });
} }

View file

@ -173,18 +173,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: camera_android_camerax name: camera_android_camerax
sha256: "0bd3d1645df00af2540a22df13ba466ac5fb2838a09bce4089cecdb1712a9e94" sha256: "68d7ec97439108ac22cfba34bb74d0ab53adbc017175116d2cbc5a3d8fc8ea5e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.18" version: "0.6.18+2"
camera_avfoundation: camera_avfoundation:
dependency: transitive dependency: transitive
description: description:
name: camera_avfoundation name: camera_avfoundation
sha256: fdc0e668f65c8ddfb3be6c10ef4737fb6274cd04d8053a9525d410642f7989c0 sha256: ca244564876d5a76f2126bca501aec25243cad23ba1784819242aea2fd25cf70
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.19+1" version: "0.9.19+2"
camera_platform_interface: camera_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -221,10 +221,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: checked_yaml name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
@ -959,10 +959,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: libsignal_protocol_dart name: libsignal_protocol_dart
sha256: "385c0d499d70063739ab6963455a4e889aea16d6a4c9e769371d7ed2d1427ef6" sha256: "2b18de43016474ab85d21553a88f59d6f4fea8c2eddf35be7e24ab5f8969a81d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.3" version: "0.7.4"
lints: lints:
dependency: transitive dependency: transitive
description: description:
@ -1752,14 +1752,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
very_good_analysis:
dependency: transitive
description:
name: very_good_analysis
sha256: "62d2b86d183fb81b2edc22913d9f155d26eb5cf3855173adb1f59fac85035c63"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
video_compress: video_compress:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1772,10 +1764,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: video_player name: video_player
sha256: "7d78f0cfaddc8c19d4cb2d3bebe1bfef11f2103b0a03e5398b303a1bf65eeb14" sha256: "0d55b1f1a31e5ad4c4967bfaa8ade0240b07d20ee4af1dfef5f531056512961a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.9.5" version: "2.10.0"
video_player_android: video_player_android:
dependency: transitive dependency: transitive
description: description:

View file

@ -4,7 +4,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
# Prevent accidental publishing to pub.dev. # Prevent accidental publishing to pub.dev.
publish_to: 'none' publish_to: 'none'
version: 0.0.32+32 version: 0.0.34+34
environment: environment:
sdk: ^3.6.0 sdk: ^3.6.0