Consolidate duplicated logic to retrieve groups in common.

Merges all of these into GroupsInCommonRepository:
- ConversationSettingsRepository.getGroupsInCommon()
- CallLinkIncomingRequestRepository.getGroupsInCommon()
- ContactSearchPagedDataSourceRepository.getGroupsInCommon()
- ReviewUtil.getGroupsInCommonCount()
- AboutSheetRepository.getGroupsInCommonCount()
This commit is contained in:
Jeffrey Starke
2025-04-08 11:02:29 -04:00
committed by Michelle Tang
parent c9795141df
commit aa7b61ecb1
15 changed files with 112 additions and 144 deletions

View File

@@ -7,16 +7,16 @@ package org.thoughtcrime.securesms.recipients.ui.about
import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.rx3.rxSingle
import org.thoughtcrime.securesms.database.IdentityTable
import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.groups.GroupsInCommonRepository
import org.thoughtcrime.securesms.recipients.RecipientId
class AboutSheetRepository {
fun getGroupsInCommonCount(recipientId: RecipientId): Single<Int> {
return Single.fromCallable {
SignalDatabase.groups.getPushGroupsContainingMember(recipientId).size
}.subscribeOn(Schedulers.io())
return rxSingle { GroupsInCommonRepository.getGroupsInCommonCount(recipientId) }
}
fun getVerified(recipientId: RecipientId): Single<Boolean> {