mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Upgrade to Realm 4.1.1
This commit is contained in:
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user