forked from upstream-mirrors/quik
Dismiss qkreply after marking read or sending message
This commit is contained in:
@@ -28,5 +28,6 @@ interface QkReplyView : QkView<QkReplyState> {
|
||||
val sendIntent: Observable<Unit>
|
||||
|
||||
fun setDraft(draft: String)
|
||||
fun finish()
|
||||
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class QkReplyViewModel(intent: Intent) : QkViewModel<QkReplyView, QkReplyState>(
|
||||
.withLatestFrom(conversation, { _, conversation -> conversation })
|
||||
.map { conversation -> conversation.id }
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { threadId -> markRead.execute(threadId) }
|
||||
.subscribe { threadId -> markRead.execute(threadId) { view.finish() } }
|
||||
|
||||
// Show all messages
|
||||
view.menuItemIntent
|
||||
@@ -133,8 +133,11 @@ class QkReplyViewModel(intent: Intent) : QkViewModel<QkReplyView, QkReplyState>(
|
||||
.withLatestFrom(conversation, { body, conversation ->
|
||||
val threadId = conversation.id
|
||||
val addresses = conversation.recipients.map { it.address }
|
||||
sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf()))
|
||||
|
||||
view.setDraft("")
|
||||
sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf())) {
|
||||
view.finish()
|
||||
}
|
||||
})
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe()
|
||||
|
||||
Reference in New Issue
Block a user