mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
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:
committed by
Michelle Tang
parent
c9795141df
commit
aa7b61ecb1
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user