Tap to retry sending failed SMS

This commit is contained in:
Moez Bhatti
2018-02-13 02:26:30 -05:00
parent ce8f01b707
commit 4409aff905
7 changed files with 130 additions and 31 deletions
@@ -68,6 +68,7 @@ class ComposeViewModel(intent: Intent) : QkViewModel<ComposeView, ComposeState>(
@Inject lateinit var markUnarchived: MarkUnarchived
@Inject lateinit var deleteConversation: DeleteConversation
@Inject lateinit var sendMessage: SendMessage
@Inject lateinit var retrySending: RetrySending
@Inject lateinit var markRead: MarkRead
@Inject lateinit var deleteMessage: DeleteMessage
@@ -285,6 +286,12 @@ class ComposeViewModel(intent: Intent) : QkViewModel<ComposeView, ComposeState>(
.autoDisposable(view.scope())
.subscribe { conversation -> deleteConversation.execute(conversation.id) }
view.messageClickIntent
.filter { message -> message.isFailedMessage() }
.doOnNext { message -> retrySending.execute(message) }
.autoDisposable(view.scope())
.subscribe()
// Mark the conversation read, if in foreground
Observables.combineLatest(messages, view.activityVisibleIntent, { _, b -> b })
.withLatestFrom(conversation, { visible, conversation ->