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>
|
val sendIntent: Observable<Unit>
|
||||||
|
|
||||||
fun setDraft(draft: String)
|
fun setDraft(draft: String)
|
||||||
|
fun finish()
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ class QkReplyViewModel(intent: Intent) : QkViewModel<QkReplyView, QkReplyState>(
|
|||||||
.withLatestFrom(conversation, { _, conversation -> conversation })
|
.withLatestFrom(conversation, { _, conversation -> conversation })
|
||||||
.map { conversation -> conversation.id }
|
.map { conversation -> conversation.id }
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { threadId -> markRead.execute(threadId) }
|
.subscribe { threadId -> markRead.execute(threadId) { view.finish() } }
|
||||||
|
|
||||||
// Show all messages
|
// Show all messages
|
||||||
view.menuItemIntent
|
view.menuItemIntent
|
||||||
@@ -133,8 +133,11 @@ class QkReplyViewModel(intent: Intent) : QkViewModel<QkReplyView, QkReplyState>(
|
|||||||
.withLatestFrom(conversation, { body, conversation ->
|
.withLatestFrom(conversation, { body, conversation ->
|
||||||
val threadId = conversation.id
|
val threadId = conversation.id
|
||||||
val addresses = conversation.recipients.map { it.address }
|
val addresses = conversation.recipients.map { it.address }
|
||||||
sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf()))
|
|
||||||
view.setDraft("")
|
view.setDraft("")
|
||||||
|
sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf())) {
|
||||||
|
view.finish()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
|
|||||||
Reference in New Issue
Block a user