Add ability to send group messages

This commit is contained in:
Moez Bhatti
2018-01-12 14:53:58 -05:00
parent cba8ce2c2f
commit a3ccdbb667
3 changed files with 49 additions and 26 deletions
@@ -248,8 +248,8 @@ class ComposeViewModel(intent: Intent) : QkViewModel<ComposeView, ComposeState>(
.map { body -> body.toString() }
.withLatestFrom(conversation, { body, conversation ->
val threadId = conversation.id
val address = conversation.recipients.first()?.address.orEmpty()
sendMessage.execute(SendMessage.Params(threadId, address, body))
val addresses = conversation.recipients.map { it.address }
sendMessage.execute(SendMessage.Params(threadId, addresses, body))
view.setDraft("")
})
.withLatestFrom(state, { _, state ->