WIP: received message timestamps

This commit is contained in:
Ryan ZHAO 2021-02-11 16:09:59 +11:00
parent 5cbbf92fb9
commit 5dadb89225
3 changed files with 6 additions and 1 deletions

View File

@ -308,6 +308,10 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
TODO("Not yet implemented")
}
override fun removeReceivedMessageTimestamps(timestamps: Set<Long>) {
TODO("Not yet implemented")
}
override fun getMessageIdInDatabase(timestamp: Long, author: String): Long? {
val database = DatabaseFactory.getMmsSmsDatabase(context)
val address = Address.fromSerialized(author)

View File

@ -88,6 +88,7 @@ interface StorageProtocol {
// Message Handling
fun getReceivedMessageTimestamps(): Set<Long>
fun addReceivedMessageTimestamp(timestamp: Long)
fun removeReceivedMessageTimestamps(timestamps: Set<Long>)
// Returns the IDs of the saved attachments.
fun persistAttachments(messageId: Long, attachments: List<Attachment>): List<Long>

View File

@ -63,7 +63,7 @@ object MessageReceiver {
} else {
when (envelope.type) {
SignalServiceProtos.Envelope.Type.UNIDENTIFIED_SENDER -> {
val userX25519KeyPair = MessagingConfiguration.shared.storage.getUserX25519KeyPair() ?: throw Error.NoUserX25519KeyPair
val userX25519KeyPair = MessagingConfiguration.shared.storage.getUserX25519KeyPair()
val decryptionResult = MessageReceiverDecryption.decryptWithSessionProtocol(ciphertext.toByteArray(), userX25519KeyPair)
plaintext = decryptionResult.first
sender = decryptionResult.second