Commit e50d1438 authored by Leonardo Aramaki's avatar Leonardo Aramaki

wrap getMessageReadReceipts call in retryIO

parent f4bc2d1d
...@@ -8,6 +8,7 @@ import chat.rocket.android.server.domain.GetCurrentServerInteractor ...@@ -8,6 +8,7 @@ import chat.rocket.android.server.domain.GetCurrentServerInteractor
import chat.rocket.android.server.domain.MessagesRepository import chat.rocket.android.server.domain.MessagesRepository
import chat.rocket.android.server.infraestructure.ConnectionManagerFactory import chat.rocket.android.server.infraestructure.ConnectionManagerFactory
import chat.rocket.android.util.extensions.launchUI import chat.rocket.android.util.extensions.launchUI
import chat.rocket.android.util.retryIO
import chat.rocket.common.RocketChatException import chat.rocket.common.RocketChatException
import chat.rocket.core.internal.rest.getMessageReadReceipts import chat.rocket.core.internal.rest.getMessageReadReceipts
import chat.rocket.core.internal.rest.queryUsers import chat.rocket.core.internal.rest.queryUsers
...@@ -30,7 +31,9 @@ class MessageInfoPresenter @Inject constructor( ...@@ -30,7 +31,9 @@ class MessageInfoPresenter @Inject constructor(
launchUI(strategy) { launchUI(strategy) {
try { try {
view.showLoading() view.showLoading()
val readReceipts = client.getMessageReadReceipts(messageId = messageId).result val readReceipts = retryIO(description = "getMessageReadReceipts") {
client.getMessageReadReceipts(messageId = messageId).result
}
view.showReadReceipts(mapper.map(readReceipts)) view.showReadReceipts(mapper.map(readReceipts))
} catch (ex: RocketChatException) { } catch (ex: RocketChatException) {
Timber.e(ex) Timber.e(ex)
...@@ -40,4 +43,4 @@ class MessageInfoPresenter @Inject constructor( ...@@ -40,4 +43,4 @@ class MessageInfoPresenter @Inject constructor(
} }
} }
} }
} }
\ No newline at end of file
...@@ -108,4 +108,4 @@ class MessageInfoFragment : Fragment(), MessageInfoView { ...@@ -108,4 +108,4 @@ class MessageInfoFragment : Fragment(), MessageInfoView {
companion object { companion object {
const val TAG_MESSAGE_INFO_FRAGMENT = "MessageInfoFragment" const val TAG_MESSAGE_INFO_FRAGMENT = "MessageInfoFragment"
} }
} }
\ No newline at end of file
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="04/06/2018 14:18:36" /> tools:text="04/06/2018 14:18:36" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
\ No newline at end of file
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