Commit 48d817fa authored by Leonardo Aramaki's avatar Leonardo Aramaki

Remove retryIO when sending messages letting the JobScheduler to do this job...

Remove retryIO when sending messages letting the JobScheduler to do this job and always keep the send button enabled since we are now offline
parent cdfe7720
...@@ -106,12 +106,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView, ...@@ -106,12 +106,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
fun sendMessage(chatRoomId: String, text: String, messageId: String?) { fun sendMessage(chatRoomId: String, text: String, messageId: String?) {
launchUI(strategy) { launchUI(strategy) {
view.disableSendMessageButton()
try { try {
// ignore message for now, will receive it on the stream // ignore message for now, will receive it on the stream
val id = UUID.randomUUID().toString() val id = UUID.randomUUID().toString()
val message = retryIO { val message = if (messageId == null) {
if (messageId == null) {
val username = localRepository.username() val username = localRepository.username()
val newMessage = Message( val newMessage = Message(
id = id, id = id,
...@@ -141,7 +139,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView, ...@@ -141,7 +139,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
} else { } else {
client.updateMessage(chatRoomId, messageId, text) client.updateMessage(chatRoomId, messageId, text)
} }
}
view.enableSendMessageButton() view.enableSendMessageButton()
} catch (ex: Exception) { } catch (ex: Exception) {
Timber.d(ex, "Error sending message...") Timber.d(ex, "Error sending message...")
......
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