Update libsignal-service-java

This commit is contained in:
AsamK 2021-05-19 22:51:35 +02:00
parent f445cfb5c1
commit 30690785fd
19 changed files with 71 additions and 42 deletions

View file

@ -14,7 +14,7 @@ repositories {
}
dependencies {
api("com.github.turasa:signal-service-java:2.15.3_unofficial_22")
api("com.github.turasa:signal-service-java:2.15.3_unofficial_23")
implementation("com.google.protobuf:protobuf-javalite:3.10.0")
implementation("org.bouncycastle:bcprov-jdk15on:1.68")
implementation("org.slf4j:slf4j-api:1.7.30")

View file

@ -74,11 +74,15 @@ public class AvatarStore {
}
private File getContactAvatarFile(SignalServiceAddress address) {
return new File(avatarsPath, "contact-" + address.getLegacyIdentifier());
return new File(avatarsPath, "contact-" + getLegacyIdentifier(address));
}
private String getLegacyIdentifier(final SignalServiceAddress address) {
return address.getNumber().or(() -> address.getUuid().get().toString());
}
private File getProfileAvatarFile(SignalServiceAddress address) {
return new File(avatarsPath, "profile-" + address.getLegacyIdentifier());
return new File(avatarsPath, "profile-" + getLegacyIdentifier(address));
}
private void createAvatarsDir() throws IOException {

View file

@ -641,7 +641,7 @@ public class Manager implements Closeable {
}
} catch (InvalidKeyException ignored) {
logger.warn("Got invalid identity key in profile for {}",
resolveSignalServiceAddress(recipientId).getLegacyIdentifier());
resolveSignalServiceAddress(recipientId).getIdentifier());
}
return profileAndCredential;
}

View file

@ -176,7 +176,8 @@ public class GroupV2Helper {
final var noUuidCapability = members.stream()
.map(addressResolver::resolveSignalServiceAddress)
.filter(address -> !address.getUuid().isPresent())
.map(SignalServiceAddress::getLegacyIdentifier)
.map(SignalServiceAddress::getNumber)
.map(Optional::get)
.collect(Collectors.toSet());
if (noUuidCapability.size() > 0) {
logger.warn("Cannot create a V2 group as some members don't have a UUID: {}",

View file

@ -96,7 +96,7 @@ public class MessageCacheUtils {
out.writeInt(0);
}
out.writeLong(envelope.getServerReceivedTimestamp());
var uuid = envelope.getUuid();
var uuid = envelope.getServerGuid();
out.writeUTF(uuid == null ? "" : uuid);
out.writeLong(envelope.getServerDeliveredTimestamp());
}