mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 13:08:42 +00:00
bump version
This commit is contained in:
parent
37b11cef79
commit
0eda03537c
5 changed files with 37 additions and 39 deletions
|
|
@ -66,6 +66,15 @@ class MessageRetransmissionDao extends DatabaseAccessor<TwonlyDatabase>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<MessageRetransmission?> getRetransmissionFromHash(
|
||||||
|
int fromUserId, Uint8List encryptedHash) async {
|
||||||
|
return ((select(messageRetransmissions))
|
||||||
|
..where((m) =>
|
||||||
|
m.contactId.equals(fromUserId) &
|
||||||
|
m.encryptedHash.equals(encryptedHash)))
|
||||||
|
.getSingleOrNull();
|
||||||
|
}
|
||||||
|
|
||||||
Future deleteRetransmissionById(int retransmissionId) {
|
Future deleteRetransmissionById(int retransmissionId) {
|
||||||
return (delete(messageRetransmissions)
|
return (delete(messageRetransmissions)
|
||||||
..where((t) => t.retransmissionId.equals(retransmissionId)))
|
..where((t) => t.retransmissionId.equals(retransmissionId)))
|
||||||
|
|
|
||||||
|
|
@ -32,14 +32,12 @@ Future tryTransmitMessages() async {
|
||||||
if (retransIds.isEmpty) return;
|
if (retransIds.isEmpty) return;
|
||||||
|
|
||||||
for (final retransId in retransIds) {
|
for (final retransId in retransIds) {
|
||||||
sendRetransmitMessage(retransId, fromRetransmissionDb: true);
|
await sendRetransmitMessage(retransId);
|
||||||
//twonlyDB.messageRetransmissionDao.deleteRetransmissionById(retransId);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future sendRetransmitMessage(int retransId,
|
Future sendRetransmitMessage(int retransId) async {
|
||||||
{bool fromRetransmissionDb = false}) async {
|
|
||||||
try {
|
try {
|
||||||
MessageRetransmission? retrans = await twonlyDB.messageRetransmissionDao
|
MessageRetransmission? retrans = await twonlyDB.messageRetransmissionDao
|
||||||
.getRetransmissionById(retransId)
|
.getRetransmissionById(retransId)
|
||||||
|
|
@ -63,14 +61,6 @@ Future sendRetransmitMessage(int retransId,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
DateTime timestampToCheck = DateTime.parse("2025-07-14T00:36:00");
|
|
||||||
if (json.timestamp.isBefore(timestampToCheck)) {
|
|
||||||
Log.info("Ignoring retransmission because it is before the update...");
|
|
||||||
await twonlyDB.messageRetransmissionDao
|
|
||||||
.deleteRetransmissionById(retransId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.info("Retransmitting $retransId: ${json.kind} to ${retrans.contactId}");
|
Log.info("Retransmitting $retransId: ${json.kind} to ${retrans.contactId}");
|
||||||
|
|
||||||
Contact? contact = await twonlyDB.contactsDao
|
Contact? contact = await twonlyDB.contactsDao
|
||||||
|
|
|
||||||
|
|
@ -132,11 +132,16 @@ Future<client.Response> handleNewMessage(int fromUserId, Uint8List body) async {
|
||||||
|
|
||||||
final content = message.content;
|
final content = message.content;
|
||||||
if (content is SignalDecryptErrorContent) {
|
if (content is SignalDecryptErrorContent) {
|
||||||
|
final hash = Uint8List.fromList(content.encryptedHash);
|
||||||
await twonlyDB.messageRetransmissionDao.resetAckStatusFor(
|
await twonlyDB.messageRetransmissionDao.resetAckStatusFor(
|
||||||
fromUserId,
|
fromUserId,
|
||||||
Uint8List.fromList(content.encryptedHash),
|
hash,
|
||||||
);
|
);
|
||||||
tryTransmitMessages();
|
final message = await twonlyDB.messageRetransmissionDao
|
||||||
|
.getRetransmissionFromHash(fromUserId, hash);
|
||||||
|
if (message != null) {
|
||||||
|
sendRetransmitMessage(message.retransmissionId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ import 'package:twonly/src/views/camera/camera_send_to_view.dart';
|
||||||
import 'package:twonly/src/views/camera/image_editor/action_button.dart';
|
import 'package:twonly/src/views/camera/image_editor/action_button.dart';
|
||||||
import 'package:twonly/src/views/components/media_view_sizing.dart';
|
import 'package:twonly/src/views/components/media_view_sizing.dart';
|
||||||
import 'package:twonly/src/views/camera/camera_preview_components/permissions_view.dart';
|
import 'package:twonly/src/views/camera/camera_preview_components/permissions_view.dart';
|
||||||
import 'package:twonly/src/utils/storage.dart';
|
|
||||||
import 'package:twonly/src/views/camera/share_image_editor_view.dart';
|
import 'package:twonly/src/views/camera/share_image_editor_view.dart';
|
||||||
import 'package:twonly/src/views/home.view.dart';
|
import 'package:twonly/src/views/home.view.dart';
|
||||||
|
|
||||||
|
|
@ -143,7 +142,6 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
double basePanY = 0;
|
double basePanY = 0;
|
||||||
double baseScaleFactor = 0;
|
double baseScaleFactor = 0;
|
||||||
bool cameraLoaded = false;
|
bool cameraLoaded = false;
|
||||||
bool useHighQuality = false;
|
|
||||||
bool isVideoRecording = false;
|
bool isVideoRecording = false;
|
||||||
bool hasAudioPermission = true;
|
bool hasAudioPermission = true;
|
||||||
bool videoWithAudio = true;
|
bool videoWithAudio = true;
|
||||||
|
|
@ -174,9 +172,6 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
: CameraSendToViewState.screenshotController;
|
: CameraSendToViewState.screenshotController;
|
||||||
|
|
||||||
void initAsync() async {
|
void initAsync() async {
|
||||||
final user = await getUser();
|
|
||||||
if (user == null) return;
|
|
||||||
useHighQuality = user.useHighQuality;
|
|
||||||
hasAudioPermission = await Permission.microphone.isGranted;
|
hasAudioPermission = await Permission.microphone.isGranted;
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
@ -258,8 +253,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
cameraController?.setFlashMode(
|
cameraController?.setFlashMode(
|
||||||
selectedCameraDetails.isFlashOn ? FlashMode.always : FlashMode.off);
|
selectedCameraDetails.isFlashOn ? FlashMode.always : FlashMode.off);
|
||||||
imageBytes = screenshotController.capture(
|
imageBytes = screenshotController.capture(
|
||||||
pixelRatio:
|
pixelRatio: MediaQuery.of(context).devicePixelRatio);
|
||||||
(useHighQuality) ? MediaQuery.of(context).devicePixelRatio : 1);
|
|
||||||
|
|
||||||
if (await pushMediaEditor(imageBytes, null)) {
|
if (await pushMediaEditor(imageBytes, null)) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -279,7 +273,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
sharedFromGallery: sharedFromGallery,
|
sharedFromGallery: sharedFromGallery,
|
||||||
sendTo: widget.sendTo,
|
sendTo: widget.sendTo,
|
||||||
mirrorVideo: isFront && Platform.isAndroid,
|
mirrorVideo: isFront && Platform.isAndroid,
|
||||||
useHighQuality: useHighQuality,
|
useHighQuality: true,
|
||||||
),
|
),
|
||||||
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
return child;
|
return child;
|
||||||
|
|
@ -546,22 +540,22 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (!isFront)
|
// if (!isFront)
|
||||||
ActionButton(
|
// ActionButton(
|
||||||
Icons.hd_rounded,
|
// Icons.hd_rounded,
|
||||||
tooltipText: context.lang.toggleHighQuality,
|
// tooltipText: context.lang.toggleHighQuality,
|
||||||
color: useHighQuality
|
// color: useHighQuality
|
||||||
? Colors.white
|
// ? Colors.white
|
||||||
: Colors.white.withAlpha(160),
|
// : Colors.white.withAlpha(160),
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
useHighQuality = !useHighQuality;
|
// useHighQuality = !useHighQuality;
|
||||||
setState(() {});
|
// setState(() {});
|
||||||
await updateUserdata((user) {
|
// await updateUserdata((user) {
|
||||||
user.useHighQuality = useHighQuality;
|
// user.useHighQuality = useHighQuality;
|
||||||
return user;
|
// return user;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
if (!hasAudioPermission)
|
if (!hasAudioPermission)
|
||||||
ActionButton(
|
ActionButton(
|
||||||
Icons.mic_off_rounded,
|
Icons.mic_off_rounded,
|
||||||
|
|
|
||||||
|
|
@ -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.56+56
|
version: 0.0.57+57
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.6.0
|
sdk: ^3.6.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue