mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
fix smaller issues
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
6b353d8a66
commit
e97f0a910f
5 changed files with 25 additions and 26 deletions
|
|
@ -224,29 +224,25 @@ Future<void> downloadFileFast(
|
||||||
|
|
||||||
Future<void> requestMediaReupload(String mediaId) async {
|
Future<void> requestMediaReupload(String mediaId) async {
|
||||||
final messages = await twonlyDB.messagesDao.getMessagesByMediaId(mediaId);
|
final messages = await twonlyDB.messagesDao.getMessagesByMediaId(mediaId);
|
||||||
if (messages.length != 1 || messages.first.senderId == null) {
|
|
||||||
Log.error(
|
|
||||||
'Media file has none or more than one sender. That is not possible',
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await sendCipherText(
|
for (final message in messages) {
|
||||||
messages.first.senderId!,
|
if (message.openedAt != null) continue;
|
||||||
EncryptedContent(
|
await sendCipherText(
|
||||||
mediaUpdate: EncryptedContent_MediaUpdate(
|
messages.first.senderId!,
|
||||||
type: EncryptedContent_MediaUpdate_Type.DECRYPTION_ERROR,
|
EncryptedContent(
|
||||||
targetMessageId: messages.first.messageId,
|
mediaUpdate: EncryptedContent_MediaUpdate(
|
||||||
|
type: EncryptedContent_MediaUpdate_Type.DECRYPTION_ERROR,
|
||||||
|
targetMessageId: messages.first.messageId,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
await twonlyDB.mediaFilesDao.updateMedia(
|
||||||
|
mediaId,
|
||||||
await twonlyDB.mediaFilesDao.updateMedia(
|
const MediaFilesCompanion(
|
||||||
mediaId,
|
downloadState: Value(DownloadState.reuploadRequested),
|
||||||
const MediaFilesCompanion(
|
),
|
||||||
downloadState: Value(DownloadState.reuploadRequested),
|
);
|
||||||
),
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> handleEncryptedFile(String mediaId) async {
|
Future<void> handleEncryptedFile(String mediaId) async {
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,10 @@ Future<(Uint8List, Uint8List?)?> tryToSendCompleteMessage({
|
||||||
}
|
}
|
||||||
receiptId = receipt.receiptId;
|
receiptId = receipt.receiptId;
|
||||||
|
|
||||||
if (!onlyReturnEncryptedData && receipt.ackByServerAt != null) {
|
if (!onlyReturnEncryptedData &&
|
||||||
Log.error('message already uploaded!');
|
receipt.ackByServerAt != null &&
|
||||||
|
receipt.markForRetry == null) {
|
||||||
|
Log.error('Message already uploaded and mark for retry is not set!');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,6 +143,7 @@ Future<(Uint8List, Uint8List?)?> tryToSendCompleteMessage({
|
||||||
ackByServerAt: Value(DateTime.now()),
|
ackByServerAt: Value(DateTime.now()),
|
||||||
retryCount: Value(receipt.retryCount + 1),
|
retryCount: Value(receipt.retryCount + 1),
|
||||||
lastRetry: Value(DateTime.now()),
|
lastRetry: Value(DateTime.now()),
|
||||||
|
markForRetry: const Value(null),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ Future<SignalContactSignedPreKey?> getSignedPreKeyByContactId(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unawaited(requestNewSignedPreKeyForContact(contactId));
|
unawaited(requestNewSignedPreKeyForContact(contactId));
|
||||||
Log.error('Contact $contactId does not have a signed pre key!');
|
Log.warn('Contact $contactId does not have a signed pre key!');
|
||||||
}
|
}
|
||||||
return signedPreKey;
|
return signedPreKey;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class _ProfileViewState extends State<ProfileView> {
|
||||||
..avatarCounter = user.avatarCounter + 1;
|
..avatarCounter = user.avatarCounter + 1;
|
||||||
return user;
|
return user;
|
||||||
});
|
});
|
||||||
setState(() {}); // gUser has updated
|
if (mounted) setState(() {}); // gUser has updated
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _updateUsername(String username) async {
|
Future<void> _updateUsername(String username) async {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.0.82+82
|
version: 0.0.83+83
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.6.0
|
sdk: ^3.6.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue