mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Do most of the proto and database groundwork for the new mediaName.
This commit is contained in:
committed by
Cody Henthorne
parent
e705495638
commit
38c8f852bf
@@ -23,13 +23,7 @@ class ArchivedAttachment : Attachment {
|
||||
val archiveCdn: Int?
|
||||
|
||||
@JvmField
|
||||
val archiveMediaName: String
|
||||
|
||||
@JvmField
|
||||
val archiveMediaId: String
|
||||
|
||||
@JvmField
|
||||
val archiveThumbnailMediaId: String
|
||||
val plaintextHash: ByteArray
|
||||
|
||||
constructor(
|
||||
contentType: String?,
|
||||
@@ -37,13 +31,9 @@ class ArchivedAttachment : Attachment {
|
||||
cdn: Int,
|
||||
uploadTimestamp: Long?,
|
||||
key: ByteArray,
|
||||
iv: ByteArray?,
|
||||
cdnKey: String?,
|
||||
archiveCdn: Int?,
|
||||
archiveMediaName: String,
|
||||
archiveMediaId: String,
|
||||
archiveThumbnailMediaId: String,
|
||||
digest: ByteArray,
|
||||
plaintextHash: ByteArray,
|
||||
incrementalMac: ByteArray?,
|
||||
incrementalMacChunkSize: Int?,
|
||||
width: Int?,
|
||||
@@ -66,8 +56,7 @@ class ArchivedAttachment : Attachment {
|
||||
cdn = Cdn.fromCdnNumber(cdn),
|
||||
remoteLocation = cdnKey,
|
||||
remoteKey = Base64.encodeWithoutPadding(key),
|
||||
remoteIv = iv,
|
||||
remoteDigest = digest,
|
||||
remoteDigest = null,
|
||||
incrementalDigest = incrementalMac,
|
||||
fastPreflightId = null,
|
||||
voiceNote = voiceNote,
|
||||
@@ -85,24 +74,18 @@ class ArchivedAttachment : Attachment {
|
||||
uuid = uuid
|
||||
) {
|
||||
this.archiveCdn = archiveCdn
|
||||
this.archiveMediaName = archiveMediaName
|
||||
this.archiveMediaId = archiveMediaId
|
||||
this.archiveThumbnailMediaId = archiveThumbnailMediaId
|
||||
this.plaintextHash = plaintextHash
|
||||
}
|
||||
|
||||
constructor(parcel: Parcel) : super(parcel) {
|
||||
archiveCdn = parcel.readInt().takeIf { it != NO_ARCHIVE_CDN }
|
||||
archiveMediaName = parcel.readString()!!
|
||||
archiveMediaId = parcel.readString()!!
|
||||
archiveThumbnailMediaId = parcel.readString()!!
|
||||
plaintextHash = parcel.createByteArray()!!
|
||||
}
|
||||
|
||||
override fun writeToParcel(dest: Parcel, flags: Int) {
|
||||
super.writeToParcel(dest, flags)
|
||||
dest.writeInt(archiveCdn ?: NO_ARCHIVE_CDN)
|
||||
dest.writeString(archiveMediaName)
|
||||
dest.writeString(archiveMediaId)
|
||||
dest.writeString(archiveThumbnailMediaId)
|
||||
dest.writeByteArray(plaintextHash)
|
||||
}
|
||||
|
||||
override val uri: Uri? = null
|
||||
|
||||
@@ -39,8 +39,6 @@ abstract class Attachment(
|
||||
@JvmField
|
||||
val remoteKey: String?,
|
||||
@JvmField
|
||||
val remoteIv: ByteArray?,
|
||||
@JvmField
|
||||
val remoteDigest: ByteArray?,
|
||||
@JvmField
|
||||
val incrementalDigest: ByteArray?,
|
||||
@@ -90,7 +88,6 @@ abstract class Attachment(
|
||||
cdn = Cdn.deserialize(parcel.readInt()),
|
||||
remoteLocation = parcel.readString(),
|
||||
remoteKey = parcel.readString(),
|
||||
remoteIv = ParcelUtil.readByteArray(parcel),
|
||||
remoteDigest = ParcelUtil.readByteArray(parcel),
|
||||
incrementalDigest = ParcelUtil.readByteArray(parcel),
|
||||
fastPreflightId = parcel.readString(),
|
||||
|
||||
@@ -54,7 +54,6 @@ class DatabaseAttachment : Attachment {
|
||||
cdn: Cdn,
|
||||
location: String?,
|
||||
key: String?,
|
||||
iv: ByteArray?,
|
||||
digest: ByteArray?,
|
||||
incrementalDigest: ByteArray?,
|
||||
incrementalMacChunkSize: Int,
|
||||
@@ -85,7 +84,6 @@ class DatabaseAttachment : Attachment {
|
||||
cdn = cdn,
|
||||
remoteLocation = location,
|
||||
remoteKey = key,
|
||||
remoteIv = iv,
|
||||
remoteDigest = digest,
|
||||
incrementalDigest = incrementalDigest,
|
||||
fastPreflightId = fastPreflightId,
|
||||
|
||||
@@ -47,7 +47,6 @@ class PointerAttachment : Attachment {
|
||||
cdn = cdn,
|
||||
remoteLocation = location,
|
||||
remoteKey = key,
|
||||
remoteIv = iv,
|
||||
remoteDigest = digest,
|
||||
incrementalDigest = incrementalDigest,
|
||||
fastPreflightId = fastPreflightId,
|
||||
|
||||
@@ -23,7 +23,6 @@ class TombstoneAttachment : Attachment {
|
||||
cdn = Cdn.CDN_0,
|
||||
remoteLocation = null,
|
||||
remoteKey = null,
|
||||
remoteIv = null,
|
||||
remoteDigest = null,
|
||||
incrementalDigest = null,
|
||||
fastPreflightId = null,
|
||||
@@ -66,7 +65,6 @@ class TombstoneAttachment : Attachment {
|
||||
cdn = Cdn.CDN_0,
|
||||
remoteLocation = null,
|
||||
remoteKey = null,
|
||||
remoteIv = null,
|
||||
remoteDigest = null,
|
||||
incrementalDigest = incrementalMac,
|
||||
fastPreflightId = null,
|
||||
|
||||
@@ -75,7 +75,6 @@ class UriAttachment : Attachment {
|
||||
cdn = Cdn.CDN_0,
|
||||
remoteLocation = null,
|
||||
remoteKey = null,
|
||||
remoteIv = null,
|
||||
remoteDigest = null,
|
||||
incrementalDigest = null,
|
||||
fastPreflightId = fastPreflightId,
|
||||
|
||||
@@ -20,7 +20,6 @@ class WallpaperAttachment() : Attachment(
|
||||
cdn = Cdn.CDN_0,
|
||||
remoteLocation = null,
|
||||
remoteKey = null,
|
||||
remoteIv = null,
|
||||
remoteDigest = null,
|
||||
incrementalDigest = null,
|
||||
fastPreflightId = null,
|
||||
|
||||
Reference in New Issue
Block a user