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() { ...@@ -50,7 +50,6 @@ class MessageService : JobService() {
val client = connectionManager.client val client = connectionManager.client
temporaryMessages.forEach { message -> temporaryMessages.forEach { message ->
try { try {
messageRepository.save(message.copy(isTemporary = false))
client.sendMessage( client.sendMessage(
message = message.message, message = message.message,
messageId = message.id, messageId = message.id,
...@@ -59,6 +58,7 @@ class MessageService : JobService() { ...@@ -59,6 +58,7 @@ class MessageService : JobService() {
attachments = message.attachments, attachments = message.attachments,
alias = message.senderAlias alias = message.senderAlias
) )
messageRepository.save(message.copy(isTemporary = false))
Timber.d("Sent scheduled message given by id: ${message.id}") Timber.d("Sent scheduled message given by id: ${message.id}")
} catch (ex: RocketChatException) { } catch (ex: RocketChatException) {
Timber.e(ex) 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