multiple bug issues

This commit is contained in:
otsmr 2026-05-17 19:25:08 +02:00
parent df974cd9f7
commit c77c369212
3 changed files with 15 additions and 4 deletions

View file

@ -197,7 +197,14 @@ class MediaFileService {
Future<void> createThumbnail() async {
if (!storedPath.existsSync()) {
Log.error('Could not create Thumbnail as stored media does not exists.');
if (mediaFile.stored &&
mediaFile.createdAt.isBefore(
clock.now().subtract(const Duration(days: 30)),
)) {
// media files does not exists any more so also delete the database entry
await twonlyDB.mediaFilesDao.deleteMediaFile(mediaFile.mediaId);
fullMediaRemoval();
}
return;
}
var success = false;

View file

@ -285,7 +285,7 @@ Future<PushNotification?> getPushNotificationFromEncryptedContent(
if (content.hasMediaUpdate()) {
final msg = await twonlyDB.messagesDao
.getMessageById(content.reaction.targetMessageId)
.getMessageById(content.mediaUpdate.targetMessageId)
.getSingleOrNull();
// These notifications should only be send to the original sender.
if (msg == null || msg.senderId != toUserId) {
@ -304,7 +304,9 @@ Future<PushNotification?> getPushNotificationFromEncryptedContent(
if (content.hasGroupCreate()) {
kind = PushKind.ADDED_TO_GROUP;
final group = await twonlyDB.groupsDao.getGroup(content.groupId);
additionalContent = group!.groupName;
if (group != null) {
additionalContent = group.groupName;
}
}
if (kind == null) return null;

View file

@ -91,7 +91,9 @@ class HomeViewState extends State<HomeView> {
streamHomeViewPageIndex.add(0);
});
if (initialPage == 1) {
unawaited(_mainCameraController.selectCamera(0, true));
}
unawaited(_initAsync());
// Subscribe to all events (initial link and further)