Convert AttachmentTable and models to kotlin.

This commit is contained in:
Greyson Parrelli
2024-01-03 14:43:05 -05:00
committed by Alex Hart
parent 888a40a5c4
commit 3554f82ea3
62 changed files with 2626 additions and 2986 deletions

View File

@@ -21,8 +21,8 @@ public class AttachmentDatabaseTransformPropertiesTest {
AttachmentTable.TransformProperties properties = AttachmentTable.TransformProperties.parse(json);
assertEquals(0, properties.getSentMediaQuality());
assertEquals(SentMediaQuality.STANDARD, SentMediaQuality.fromCode(properties.getSentMediaQuality()));
assertEquals(0, properties.sentMediaQuality);
assertEquals(SentMediaQuality.STANDARD, SentMediaQuality.fromCode(properties.sentMediaQuality));
}
}

View File

@@ -228,35 +228,35 @@ class UploadDependencyGraphTest {
private fun getAttachmentForPreUpload(id: Long, attachment: Attachment): DatabaseAttachment {
return DatabaseAttachment(
AttachmentId(id, id),
AttachmentTable.PREUPLOAD_MESSAGE_ID,
false,
false,
attachment.contentType,
AttachmentTable.TRANSFER_PROGRESS_PENDING,
attachment.size,
attachment.fileName,
attachment.cdnNumber,
attachment.location,
attachment.key,
attachment.relay,
attachment.digest,
attachment.incrementalDigest,
attachment.incrementalMacChunkSize,
attachment.fastPreflightId,
attachment.isVoiceNote,
attachment.isBorderless,
attachment.isVideoGif,
attachment.width,
attachment.height,
attachment.isQuote,
attachment.caption,
attachment.sticker,
attachment.blurHash,
attachment.audioHash,
attachment.transformProperties,
0,
attachment.uploadTimestamp
attachmentId = AttachmentId(id, id),
mmsId = AttachmentTable.PREUPLOAD_MESSAGE_ID,
hasData = false,
hasThumbnail = false,
contentType = attachment.contentType,
transferProgress = AttachmentTable.TRANSFER_PROGRESS_PENDING,
size = attachment.size,
fileName = attachment.fileName,
cdnNumber = attachment.cdnNumber,
location = attachment.location,
key = attachment.key,
relay = attachment.relay,
digest = attachment.digest,
incrementalDigest = attachment.incrementalDigest,
incrementalMacChunkSize = attachment.incrementalMacChunkSize,
fastPreflightId = attachment.fastPreflightId,
voiceNote = attachment.voiceNote,
borderless = attachment.borderless,
videoGif = attachment.videoGif,
width = attachment.width,
height = attachment.height,
quote = attachment.quote,
caption = attachment.caption,
stickerLocator = attachment.stickerLocator,
blurHash = attachment.blurHash,
audioHash = attachment.audioHash,
transformProperties = attachment.transformProperties,
displayOrder = 0,
uploadTimestamp = attachment.uploadTimestamp
)
}