format ktlint
This commit is contained in:
parent
49b7726ac8
commit
83d937b842
@ -499,6 +499,5 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
|||||||
|
|
||||||
realm.schema.get("TimelineEventEntity")
|
realm.schema.get("TimelineEventEntity")
|
||||||
?.addField(TimelineEventEntityFields.OWNED_BY_THREAD_CHUNK, Boolean::class.java)
|
?.addField(TimelineEventEntityFields.OWNED_BY_THREAD_CHUNK, Boolean::class.java)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import io.realm.annotations.Index
|
|||||||
import io.realm.annotations.LinkingObjects
|
import io.realm.annotations.LinkingObjects
|
||||||
import org.matrix.android.sdk.internal.extensions.assertIsManaged
|
import org.matrix.android.sdk.internal.extensions.assertIsManaged
|
||||||
import org.matrix.android.sdk.internal.extensions.clearWith
|
import org.matrix.android.sdk.internal.extensions.clearWith
|
||||||
import timber.log.Timber
|
|
||||||
|
|
||||||
internal open class ChunkEntity(@Index var prevToken: String? = null,
|
internal open class ChunkEntity(@Index var prevToken: String? = null,
|
||||||
// Because of gaps we can have several chunks with nextToken == null
|
// Because of gaps we can have several chunks with nextToken == null
|
||||||
@ -75,6 +74,3 @@ internal fun ChunkEntity.deleteAndClearThreadEvents() {
|
|||||||
}
|
}
|
||||||
deleteFromRealm()
|
deleteFromRealm()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,6 @@ internal class DefaultFetchThreadTimelineTask @Inject constructor(
|
|||||||
|
|
||||||
private suspend fun handleRelationsResponse(response: RelationsResponse,
|
private suspend fun handleRelationsResponse(response: RelationsResponse,
|
||||||
params: FetchThreadTimelineTask.Params): Result {
|
params: FetchThreadTimelineTask.Params): Result {
|
||||||
|
|
||||||
val threadList = response.chunks
|
val threadList = response.chunks
|
||||||
val threadRootEvent = response.originalEvent
|
val threadRootEvent = response.originalEvent
|
||||||
val hasReachEnd = response.nextBatch == null
|
val hasReachEnd = response.nextBatch == null
|
||||||
|
@ -272,7 +272,6 @@ internal class LoadTimelineStrategy(
|
|||||||
ChunkEntity.findLastForwardChunkOfThread(it, roomId, rootThreadEventId)?.deleteAndClearThreadEvents()?.let {
|
ChunkEntity.findLastForwardChunkOfThread(it, roomId, rootThreadEventId)?.deleteAndClearThreadEvents()?.let {
|
||||||
Timber.i("###THREADS LoadTimelineStrategy [onStop] thread chunk cleared..")
|
Timber.i("###THREADS LoadTimelineStrategy [onStop] thread chunk cleared..")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,6 @@ internal class TimelineChunk(private val chunkEntity: ChunkEntity,
|
|||||||
* always fetch results, while we want our data to be up to dated.
|
* always fetch results, while we want our data to be up to dated.
|
||||||
*/
|
*/
|
||||||
suspend fun loadMoreThread(count: Int, direction: Timeline.Direction): LoadMoreResult {
|
suspend fun loadMoreThread(count: Int, direction: Timeline.Direction): LoadMoreResult {
|
||||||
|
|
||||||
return if (direction == Timeline.Direction.BACKWARDS) {
|
return if (direction == Timeline.Direction.BACKWARDS) {
|
||||||
try {
|
try {
|
||||||
fetchThreadTimelineTask.execute(FetchThreadTimelineTask.Params(
|
fetchThreadTimelineTask.execute(FetchThreadTimelineTask.Params(
|
||||||
|
@ -420,7 +420,6 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle
|
|||||||
optimizedThreadSummaryMap[it] = eventEntity
|
optimizedThreadSummaryMap[it] = eventEntity
|
||||||
// Add the same thread timeline event to Thread Chunk
|
// Add the same thread timeline event to Thread Chunk
|
||||||
addToThreadChunkIfNeeded(realm, roomId, it, timelineEventAdded, roomEntity)
|
addToThreadChunkIfNeeded(realm, roomId, it, timelineEventAdded, roomEntity)
|
||||||
|
|
||||||
} ?: run {
|
} ?: run {
|
||||||
// This is a normal event or a root thread one
|
// This is a normal event or a root thread one
|
||||||
optimizedThreadSummaryMap[eventEntity.eventId] = eventEntity
|
optimizedThreadSummaryMap[eventEntity.eventId] = eventEntity
|
||||||
@ -474,7 +473,6 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle
|
|||||||
threadId: String,
|
threadId: String,
|
||||||
timelineEventEntity: TimelineEventEntity?,
|
timelineEventEntity: TimelineEventEntity?,
|
||||||
roomEntity: RoomEntity) {
|
roomEntity: RoomEntity) {
|
||||||
|
|
||||||
val eventId = timelineEventEntity?.eventId ?: return
|
val eventId = timelineEventEntity?.eventId ?: return
|
||||||
|
|
||||||
ChunkEntity.findLastForwardChunkOfThread(realm, roomId, threadId)?.let { threadChunk ->
|
ChunkEntity.findLastForwardChunkOfThread(realm, roomId, threadId)?.let { threadChunk ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user