mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Request profiles without uuid if libzkgroup is not available
Fixes #397
This commit is contained in:
parent
425626ef94
commit
f1e5fc6c0b
1 changed files with 22 additions and 3 deletions
|
@ -95,7 +95,17 @@ public final class ProfileHelper {
|
||||||
? unidentifiedPipe
|
? unidentifiedPipe
|
||||||
: messagePipeProvider.getMessagePipe(false);
|
: messagePipeProvider.getMessagePipe(false);
|
||||||
if (pipe != null) {
|
if (pipe != null) {
|
||||||
return pipe.getProfile(address, profileKey, unidentifiedAccess, requestType);
|
try {
|
||||||
|
return pipe.getProfile(address, profileKey, unidentifiedAccess, requestType);
|
||||||
|
} catch (NoClassDefFoundError e) {
|
||||||
|
// Native zkgroup lib not available for ProfileKey
|
||||||
|
if (!address.getNumber().isPresent()) {
|
||||||
|
throw new NotFoundException("Can't request profile without number");
|
||||||
|
}
|
||||||
|
SignalServiceAddress addressWithoutUuid = new SignalServiceAddress(Optional.absent(),
|
||||||
|
address.getNumber());
|
||||||
|
return pipe.getProfile(addressWithoutUuid, profileKey, unidentifiedAccess, requestType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IOException("No pipe available!");
|
throw new IOException("No pipe available!");
|
||||||
|
@ -106,9 +116,18 @@ public final class ProfileHelper {
|
||||||
Optional<ProfileKey> profileKey,
|
Optional<ProfileKey> profileKey,
|
||||||
Optional<UnidentifiedAccess> unidentifiedAccess,
|
Optional<UnidentifiedAccess> unidentifiedAccess,
|
||||||
SignalServiceProfile.RequestType requestType
|
SignalServiceProfile.RequestType requestType
|
||||||
) {
|
) throws NotFoundException {
|
||||||
SignalServiceMessageReceiver receiver = messageReceiverProvider.getMessageReceiver();
|
SignalServiceMessageReceiver receiver = messageReceiverProvider.getMessageReceiver();
|
||||||
return receiver.retrieveProfile(address, profileKey, unidentifiedAccess, requestType);
|
try {
|
||||||
|
return receiver.retrieveProfile(address, profileKey, unidentifiedAccess, requestType);
|
||||||
|
} catch (NoClassDefFoundError e) {
|
||||||
|
// Native zkgroup lib not available for ProfileKey
|
||||||
|
if (!address.getNumber().isPresent()) {
|
||||||
|
throw new NotFoundException("Can't request profile without number");
|
||||||
|
}
|
||||||
|
SignalServiceAddress addressWithoutUuid = new SignalServiceAddress(Optional.absent(), address.getNumber());
|
||||||
|
return receiver.retrieveProfile(addressWithoutUuid, profileKey, unidentifiedAccess, requestType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<UnidentifiedAccess> getUnidentifiedAccess(SignalServiceAddress recipient) {
|
private Optional<UnidentifiedAccess> getUnidentifiedAccess(SignalServiceAddress recipient) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue