format ktlint
This commit is contained in:
parent
49b7726ac8
commit
83d937b842
@ -202,7 +202,7 @@ data class Event(
|
||||
fun getDecryptedTextSummary(): String? {
|
||||
if (isRedacted()) return "Message Deleted"
|
||||
val text = getDecryptedValue() ?: run {
|
||||
if (isPoll()) {return getPollQuestion() ?: "created a poll."}
|
||||
if (isPoll()) { return getPollQuestion() ?: "created a poll." }
|
||||
return null
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
||||
?.setNullable(PreviewUrlCacheEntityFields.IMAGE_HEIGHT, true)
|
||||
}
|
||||
|
||||
private fun migrateTo25(realm: DynamicRealm){
|
||||
private fun migrateTo25(realm: DynamicRealm) {
|
||||
Timber.d("Step 24 -> 25")
|
||||
realm.schema.get("ChunkEntity")
|
||||
?.addField(ChunkEntityFields.ROOT_THREAD_EVENT_ID, String::class.java, FieldAttribute.INDEXED)
|
||||
@ -499,6 +499,5 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
||||
|
||||
realm.schema.get("TimelineEventEntity")
|
||||
?.addField(TimelineEventEntityFields.OWNED_BY_THREAD_CHUNK, Boolean::class.java)
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import io.realm.annotations.Index
|
||||
import io.realm.annotations.LinkingObjects
|
||||
import org.matrix.android.sdk.internal.extensions.assertIsManaged
|
||||
import org.matrix.android.sdk.internal.extensions.clearWith
|
||||
import timber.log.Timber
|
||||
|
||||
internal open class ChunkEntity(@Index var prevToken: String? = null,
|
||||
// Because of gaps we can have several chunks with nextToken == null
|
||||
@ -75,6 +74,3 @@ internal fun ChunkEntity.deleteAndClearThreadEvents() {
|
||||
}
|
||||
deleteFromRealm()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -118,7 +118,6 @@ internal class DefaultFetchThreadTimelineTask @Inject constructor(
|
||||
|
||||
private suspend fun handleRelationsResponse(response: RelationsResponse,
|
||||
params: FetchThreadTimelineTask.Params): Result {
|
||||
|
||||
val threadList = response.chunks
|
||||
val threadRootEvent = response.originalEvent
|
||||
val hasReachEnd = response.nextBatch == null
|
||||
|
@ -179,7 +179,7 @@ internal class LoadTimelineStrategy(
|
||||
getContextLatch?.cancel()
|
||||
chunkEntity = null
|
||||
timelineChunk = null
|
||||
if(mode is Mode.Thread) {
|
||||
if (mode is Mode.Thread) {
|
||||
clearThreadChunkEntity(dependencies.realm.get(), mode.rootThreadEventId)
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,6 @@ internal class LoadTimelineStrategy(
|
||||
ChunkEntity.findLastForwardChunkOfThread(it, roomId, rootThreadEventId)?.deleteAndClearThreadEvents()?.let {
|
||||
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.
|
||||
*/
|
||||
suspend fun loadMoreThread(count: Int, direction: Timeline.Direction): LoadMoreResult {
|
||||
|
||||
return if (direction == Timeline.Direction.BACKWARDS) {
|
||||
try {
|
||||
fetchThreadTimelineTask.execute(FetchThreadTimelineTask.Params(
|
||||
|
@ -420,7 +420,6 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle
|
||||
optimizedThreadSummaryMap[it] = eventEntity
|
||||
// Add the same thread timeline event to Thread Chunk
|
||||
addToThreadChunkIfNeeded(realm, roomId, it, timelineEventAdded, roomEntity)
|
||||
|
||||
} ?: run {
|
||||
// This is a normal event or a root thread one
|
||||
optimizedThreadSummaryMap[eventEntity.eventId] = eventEntity
|
||||
@ -474,7 +473,6 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle
|
||||
threadId: String,
|
||||
timelineEventEntity: TimelineEventEntity?,
|
||||
roomEntity: RoomEntity) {
|
||||
|
||||
val eventId = timelineEventEntity?.eventId ?: return
|
||||
|
||||
ChunkEntity.findLastForwardChunkOfThread(realm, roomId, threadId)?.let { threadChunk ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user