mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-03 13:47:45 +00:00
message sender failed with error
This commit is contained in:
parent
f3c3483cde
commit
246eb62958
@ -287,8 +287,16 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setErrorMessage(message: Message, error: Exception) {
|
override fun setErrorMessage(messageID: Long, error: Exception) {
|
||||||
TODO("Not yet implemented")
|
val database = DatabaseFactory.getMmsSmsDatabase(context)
|
||||||
|
val messageRecord = database.getMessageFor(messageID) ?: return
|
||||||
|
if (messageRecord.isMms) {
|
||||||
|
val mmsDatabase = DatabaseFactory.getMmsDatabase(context)
|
||||||
|
mmsDatabase.markAsSentFailed(messageID)
|
||||||
|
} else {
|
||||||
|
val smsDatabase = DatabaseFactory.getSmsDatabase(context)
|
||||||
|
smsDatabase.markAsSentFailed(messageID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getGroup(groupID: String): GroupRecord? {
|
override fun getGroup(groupID: String): GroupRecord? {
|
||||||
|
@ -92,7 +92,7 @@ interface StorageProtocol {
|
|||||||
fun setOpenGroupServerMessageID(messageID: Long, serverID: Long)
|
fun setOpenGroupServerMessageID(messageID: Long, serverID: Long)
|
||||||
fun markAsSent(messageID: Long)
|
fun markAsSent(messageID: Long)
|
||||||
fun markUnidentified(messageID: Long)
|
fun markUnidentified(messageID: Long)
|
||||||
fun setErrorMessage(message: Message, error: Exception)
|
fun setErrorMessage(messageID: Long, error: Exception)
|
||||||
|
|
||||||
// Closed Groups
|
// Closed Groups
|
||||||
fun getGroup(groupID: String): GroupRecord?
|
fun getGroup(groupID: String): GroupRecord?
|
||||||
|
@ -272,6 +272,8 @@ object MessageSender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun handleFailedMessageSend(message: Message, error: Exception) {
|
fun handleFailedMessageSend(message: Message, error: Exception) {
|
||||||
MessagingConfiguration.shared.storage.setErrorMessage(message, error)
|
val storage = MessagingConfiguration.shared.storage
|
||||||
|
val messageId = storage.getMessageIdInDatabase(message.sentTimestamp!!, message.sender!!) ?: return
|
||||||
|
storage.setErrorMessage(messageId, error)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user