Commit 93abd163 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Mark message as not temporary just after a message is successfully sent

parent debc714e
......@@ -50,7 +50,6 @@ class MessageService : JobService() {
val client = connectionManager.client
temporaryMessages.forEach { message ->
try {
messageRepository.save(message.copy(isTemporary = false))
client.sendMessage(
message = message.message,
messageId = message.id,
......@@ -59,6 +58,7 @@ class MessageService : JobService() {
attachments = message.attachments,
alias = message.senderAlias
)
messageRepository.save(message.copy(isTemporary = false))
Timber.d("Sent scheduled message given by id: ${message.id}")
} catch (ex: RocketChatException) {
Timber.e(ex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment