Upgrade to Realm 4.1.1

This commit is contained in:
Moez Bhatti
2017-11-01 15:34:22 -07:00
parent 915887dc6b
commit 359e601378
5 changed files with 6 additions and 8 deletions
@@ -81,7 +81,7 @@ class NotificationManager @Inject constructor(
.setStyle(style)
if (Build.VERSION.SDK_INT >= 24 && conversation != null) {
notification.addAction(getReplyAction(conversation.contacts[0].address, conversation.id))
notification.addAction(getReplyAction(conversation.contacts[0]?.address.orEmpty(), conversation.id))
}
notificationManager.notify(threadId.toInt(), notification.build())
@@ -29,6 +29,7 @@ class MessageRepository @Inject constructor(
return Realm.getDefaultInstance()
.where(Message::class.java)
.findAllSortedAsync("date", Sort.DESCENDING)
.where()
.distinctAsync("threadId")
}
@@ -46,7 +46,7 @@ class MessagesViewModel(val threadId: Long) : QkViewModel<MessagesView, Messages
intents += view.sendIntent.subscribe {
val previousState = state.value!!
sendMessage.execute(SendMessage.Params(threadId, conversation.contacts[0].address, previousState.draft))
sendMessage.execute(SendMessage.Params(threadId, conversation.contacts[0]?.address.orEmpty(), previousState.draft))
newState { it.copy(draft = "", canSend = false) }
}
}