From 2938fa92c0a6359c94e738d1842d6bbcf7271056 Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Tue, 29 Mar 2022 11:58:11 +0300 Subject: [PATCH] Rename countThreads method --- .../sdk/internal/database/helper/ThreadEventsHelper.kt | 4 ++-- .../internal/session/room/prune/RedactionEventProcessor.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ThreadEventsHelper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ThreadEventsHelper.kt index 0e85057f23..811c520b8b 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ThreadEventsHelper.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ThreadEventsHelper.kt @@ -100,7 +100,7 @@ internal fun EventEntity.markEventAsRoot( * @return A ThreadSummary containing the counted threads and the latest event message */ internal fun EventEntity.threadSummaryInThread(realm: Realm, rootThreadEventId: String, chunkEntity: ChunkEntity?): Summary { - val numberOfThread = countThreads( + val numberOfThread = countThreadReplies( realm = realm, roomId = roomId, rootThreadEventId = rootThreadEventId @@ -135,7 +135,7 @@ internal fun EventEntity.threadSummaryInThread(realm: Realm, rootThreadEventId: * Counts the number of threads in the main timeline thread summary, * with respect to redactions. */ -internal fun countThreads(realm: Realm, roomId: String, rootThreadEventId: String): Int? = +internal fun countThreadReplies(realm: Realm, roomId: String, rootThreadEventId: String): Int? = TimelineEventEntity .whereRoomId(realm, roomId = roomId) .equalTo(TimelineEventEntityFields.ROOT.ROOT_THREAD_EVENT_ID, rootThreadEventId) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/prune/RedactionEventProcessor.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/prune/RedactionEventProcessor.kt index 4fcc47a8d4..6558a138b0 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/prune/RedactionEventProcessor.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/prune/RedactionEventProcessor.kt @@ -21,7 +21,7 @@ import org.matrix.android.sdk.api.session.events.model.Event import org.matrix.android.sdk.api.session.events.model.EventType import org.matrix.android.sdk.api.session.events.model.LocalEcho import org.matrix.android.sdk.api.session.events.model.UnsignedData -import org.matrix.android.sdk.internal.database.helper.countThreads +import org.matrix.android.sdk.internal.database.helper.countThreadReplies import org.matrix.android.sdk.internal.database.helper.findRootThreadEvent import org.matrix.android.sdk.internal.database.mapper.ContentMapper import org.matrix.android.sdk.internal.database.mapper.EventMapper @@ -123,7 +123,7 @@ internal class RedactionEventProcessor @Inject constructor() : EventInsertLivePr val rootThreadEvent = eventToPrune.findRootThreadEvent() ?: return val rootThreadEventId = eventToPrune.rootThreadEventId ?: return - val numberOfThreads = countThreads( + val numberOfThreads = countThreadReplies( realm = realm, roomId = roomId, rootThreadEventId = rootThreadEventId