Fetch PNI Credential during own profile refresh.

This commit is contained in:
Cody Henthorne
2022-05-16 14:56:48 -04:00
parent dda5ce4809
commit 3c08b070fc
13 changed files with 186 additions and 24 deletions

View File

@@ -184,12 +184,8 @@ class ContactDiscoveryRefreshV1 {
.filter(ContactDiscoveryRefreshV1::hasCommunicatedWith)
.toList();
ProfileService profileService = new ProfileService(ApplicationDependencies.getGroupsV2Operations().getProfileOperations(),
ApplicationDependencies.getSignalServiceMessageReceiver(),
ApplicationDependencies.getSignalWebSocket());
List<Observable<Pair<Recipient, ServiceResponse<ProfileAndCredential>>>> requests = Stream.of(possiblyUnlisted)
.map(r -> ProfileUtil.retrieveProfile(context, r, SignalServiceProfile.RequestType.PROFILE, profileService)
.map(r -> ProfileUtil.retrieveProfile(context, r, SignalServiceProfile.RequestType.PROFILE)
.toObservable()
.timeout(5, TimeUnit.SECONDS)
.onErrorReturn(t -> new Pair<>(r, ServiceResponse.forUnknownError(t))))