1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-09-20 04:49:08 -05:00

Fix marking message as read (#2102)

This commit is contained in:
Mikołaj Pich 2023-01-14 15:48:58 +01:00
parent 4bb1198735
commit f11354dd35
2 changed files with 5 additions and 2 deletions

View File

@ -186,7 +186,7 @@ ext {
} }
dependencies { dependencies {
implementation "io.github.wulkanowy:sdk:1.9.1" implementation "io.github.wulkanowy:sdk:1.9.2-SNAPSHOT"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.8' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.8'

View File

@ -103,7 +103,10 @@ class MessageRepository @Inject constructor(
messagesDb.loadMessageWithAttachment(message.messageGlobalKey) messagesDb.loadMessageWithAttachment(message.messageGlobalKey)
}, },
fetch = { fetch = {
sdk.init(student).getMessageDetails(it!!.message.messageGlobalKey, markAsRead) sdk.init(student).getMessageDetails(
messageKey = it!!.message.messageGlobalKey,
markAsRead = message.unread && markAsRead,
)
}, },
saveFetchResult = { old, new -> saveFetchResult = { old, new ->
checkNotNull(old) { "Fetched message no longer exist!" } checkNotNull(old) { "Fetched message no longer exist!" }