Search in sources :

Example 11 with ServiceResponse

use of org.whispersystems.signalservice.internal.ServiceResponse in project Signal-Android by WhisperSystems.

the class ProfileUtil method retrieveProfileSync.

@WorkerThread
@NonNull
public static ProfileAndCredential retrieveProfileSync(@NonNull Context context, @NonNull Recipient recipient, @NonNull SignalServiceProfile.RequestType requestType, boolean allowUnidentifiedAccess) throws IOException {
    ProfileService profileService = new ProfileService(ApplicationDependencies.getGroupsV2Operations().getProfileOperations(), ApplicationDependencies.getSignalServiceMessageReceiver(), ApplicationDependencies.getSignalWebSocket());
    Pair<Recipient, ServiceResponse<ProfileAndCredential>> response = retrieveProfile(context, recipient, requestType, profileService, allowUnidentifiedAccess).blockingGet();
    return new ProfileService.ProfileResponseProcessor(response.second()).getResultOrThrow();
}
Also used : ServiceResponse(org.whispersystems.signalservice.internal.ServiceResponse) ProfileService(org.whispersystems.signalservice.api.services.ProfileService) Recipient(org.thoughtcrime.securesms.recipients.Recipient) WorkerThread(androidx.annotation.WorkerThread) NonNull(androidx.annotation.NonNull)

Aggregations

ServiceResponse (org.whispersystems.signalservice.internal.ServiceResponse)11 List (java.util.List)6 Optional (org.whispersystems.libsignal.util.guava.Optional)6 IOException (java.io.IOException)5 NonNull (androidx.annotation.NonNull)4 Single (io.reactivex.rxjava3.core.Single)4 Locale (java.util.Locale)4 Map (java.util.Map)4 Set (java.util.Set)4 TimeUnit (java.util.concurrent.TimeUnit)4 Pair (org.whispersystems.libsignal.util.Pair)4 ProfileAndCredential (org.whispersystems.signalservice.api.profiles.ProfileAndCredential)4 SignalServiceProfile (org.whispersystems.signalservice.api.profiles.SignalServiceProfile)4 ACI (org.whispersystems.signalservice.api.push.ACI)4 TextUtils (android.text.TextUtils)3 Nullable (androidx.annotation.Nullable)3 WorkerThread (androidx.annotation.WorkerThread)3 ByteString (com.google.protobuf.ByteString)3 SecureRandom (java.security.SecureRandom)3 Collections (java.util.Collections)3