Fix behavior for recipients with only UUIDs

Fixes #359
This commit is contained in:
AsamK 2020-10-11 10:41:56 +02:00
parent ae39d6a085
commit a54fc92c05
7 changed files with 30 additions and 27 deletions

View file

@ -19,7 +19,7 @@ class JsonGroupInfo {
if (groupInfo.getMembers().isPresent()) {
this.members = new ArrayList<>(groupInfo.getMembers().get().size());
for (SignalServiceAddress address : groupInfo.getMembers().get()) {
this.members.add(address.getNumber().get());
this.members.add(address.getLegacyIdentifier());
}
}
if (groupInfo.getName().isPresent()) {

View file

@ -20,7 +20,7 @@ public class JsonMessageEnvelope {
public JsonMessageEnvelope(SignalServiceEnvelope envelope, SignalServiceContent content) {
if (!envelope.isUnidentifiedSender() && envelope.hasSource()) {
SignalServiceAddress source = envelope.getSourceAddress();
this.source = source.getNumber().get();
this.source = source.getLegacyIdentifier();
this.relay = source.getRelay().isPresent() ? source.getRelay().get() : null;
}
this.sourceDevice = envelope.getSourceDevice();
@ -28,7 +28,7 @@ public class JsonMessageEnvelope {
this.isReceipt = envelope.isReceipt();
if (content != null) {
if (envelope.isUnidentifiedSender()) {
this.source = content.getSender().getNumber().get();
this.source = content.getSender().getLegacyIdentifier();
this.sourceDevice = content.getSenderDevice();
}
if (content.getDataMessage().isPresent()) {

View file

@ -10,7 +10,7 @@ class JsonSyncDataMessage extends JsonDataMessage {
JsonSyncDataMessage(SentTranscriptMessage transcriptMessage) {
super(transcriptMessage.getMessage());
if (transcriptMessage.getDestination().isPresent()) {
this.destination = transcriptMessage.getDestination().get().getNumber().get();
this.destination = transcriptMessage.getDestination().get().getLegacyIdentifier();
}
}

View file

@ -28,7 +28,7 @@ class JsonSyncMessage {
if (syncMessage.getBlockedList().isPresent()) {
this.blockedNumbers = new ArrayList<>(syncMessage.getBlockedList().get().getAddresses().size());
for (SignalServiceAddress address : syncMessage.getBlockedList().get().getAddresses()) {
this.blockedNumbers.add(address.getNumber().get());
this.blockedNumbers.add(address.getLegacyIdentifier());
}
}
if (syncMessage.getRead().isPresent()) {