mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-31 19:34:52 +01:00
Calling syncPolls of SDK service
This commit is contained in:
parent
10be07590d
commit
e3a2000e29
@ -20,11 +20,11 @@ import androidx.lifecycle.LiveData
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.delay
|
||||
import org.matrix.android.sdk.api.session.room.model.PollResponseAggregatedSummary
|
||||
import org.matrix.android.sdk.api.session.room.poll.LoadedPollsStatus
|
||||
import org.matrix.android.sdk.api.session.room.poll.PollHistoryService
|
||||
import org.matrix.android.sdk.internal.util.time.Clock
|
||||
import timber.log.Timber
|
||||
|
||||
private const val LOADING_PERIOD_IN_DAYS = 30
|
||||
private const val EVENTS_PAGE_SIZE = 250
|
||||
@ -42,10 +42,6 @@ internal class DefaultPollHistoryService @AssistedInject constructor(
|
||||
fun create(roomId: String): DefaultPollHistoryService
|
||||
}
|
||||
|
||||
init {
|
||||
Timber.d("init with roomId: $roomId")
|
||||
}
|
||||
|
||||
override val loadingPeriodInDays: Int
|
||||
get() = LOADING_PERIOD_IN_DAYS
|
||||
|
||||
@ -68,10 +64,11 @@ internal class DefaultPollHistoryService @AssistedInject constructor(
|
||||
}
|
||||
|
||||
override suspend fun syncPolls() {
|
||||
TODO("Not yet implemented")
|
||||
// TODO unmock
|
||||
delay(1000)
|
||||
}
|
||||
|
||||
override fun getPolls(): LiveData<List<PollResponseAggregatedSummary>> {
|
||||
TODO("Not yet implemented")
|
||||
TODO("listen database and update query depending on latest PollHistoryStatusEntity.oldestTimestampReachedMs")
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ package im.vector.app.features.roomprofile.polls.list.data
|
||||
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.features.roomprofile.polls.list.ui.PollSummary
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
@ -60,9 +59,6 @@ class RoomPollDataSource @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun syncPolls(roomId: String) {
|
||||
Timber.d("roomId=$roomId")
|
||||
// TODO unmock using SDK service
|
||||
// fake sync
|
||||
delay(1000)
|
||||
getPollHistoryService(roomId).syncPolls()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user