Fix voice message forwarding and playback

This commit is contained in:
Курнат Андрей
2026-07-14 14:53:18 +03:00
parent edf108f621
commit 8e9a4c1151
13 changed files with 618 additions and 37 deletions
+18 -1
View File
@@ -80,7 +80,24 @@ public static class QMaxDatabaseCleanup
WHERE message.Direction = 'Outgoing'
AND localAttachment.Id <> remoteAttachment.Id
AND localAttachment.SortOrder = remoteAttachment.SortOrder
AND localAttachment.Kind = remoteAttachment.Kind
AND (
localAttachment.Kind = remoteAttachment.Kind OR
(
localAttachment.Kind = 'VoiceNote'
AND remoteAttachment.Kind = 'File'
AND localAttachment.FileSizeBytes = remoteAttachment.FileSizeBytes
AND (
lower(remoteAttachment.ContentType) LIKE 'audio/%' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.m4a' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.ogg' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.opus' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.aac' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.mp3' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.wav' OR
lower(remoteAttachment.OriginalFileName) LIKE '%.flac'
)
)
)
AND (localAttachment.ExternalId IS NULL OR trim(localAttachment.ExternalId) = '')
AND (localAttachment.RemoteUrl IS NULL OR trim(localAttachment.RemoteUrl) = '')
AND localAttachment.StorageFileName NOT LIKE 'remote-%'