mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 21:07:42 +00:00
fix: R.color.destructive on the error drawable in conversation and home adapter and handling message re-sending
This commit is contained in:
@@ -89,6 +89,7 @@ interface StorageProtocol {
|
||||
fun persistAttachments(messageID: Long, attachments: List<Attachment>): List<Long>
|
||||
fun getAttachmentsForMessage(messageID: Long): List<DatabaseAttachment>
|
||||
fun getMessageIdInDatabase(timestamp: Long, author: String): Long? // TODO: This is a weird name
|
||||
fun markAsSending(timestamp: Long, author: String)
|
||||
fun markAsSent(timestamp: Long, author: String)
|
||||
fun markUnidentified(timestamp: Long, author: String)
|
||||
fun setErrorMessage(timestamp: Long, author: String, error: Exception)
|
||||
|
@@ -3,6 +3,8 @@ package org.session.libsession.messaging.jobs
|
||||
import com.esotericsoftware.kryo.Kryo
|
||||
import com.esotericsoftware.kryo.io.Input
|
||||
import com.esotericsoftware.kryo.io.Output
|
||||
import nl.komponents.kovenant.FailedException
|
||||
import nl.komponents.kovenant.Promise
|
||||
import org.session.libsession.messaging.MessagingModuleConfiguration
|
||||
import org.session.libsession.messaging.jobs.Job.Companion.MAX_BUFFER_SIZE
|
||||
import org.session.libsession.messaging.messages.Destination
|
||||
@@ -55,7 +57,7 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
||||
return
|
||||
} // Wait for all attachments to upload before continuing
|
||||
}
|
||||
MessageSender.send(this.message, this.destination).success {
|
||||
val promise = MessageSender.send(this.message, this.destination).success {
|
||||
this.handleSuccess()
|
||||
}.fail { exception ->
|
||||
Log.e(TAG, "Couldn't send message due to error: $exception.")
|
||||
@@ -64,6 +66,11 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
||||
}
|
||||
this.handleFailure(exception)
|
||||
}
|
||||
try {
|
||||
promise.get()
|
||||
} catch (e: Exception) {
|
||||
Log.d(TAG, "Promise failed to resolve successfully", e)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSuccess() {
|
||||
|
Reference in New Issue
Block a user