Improve SignalServiceAddress handling

This commit is contained in:
AsamK 2019-12-30 16:06:16 +01:00
parent 4ca3fe87f4
commit 6cfddc0aff
8 changed files with 101 additions and 60 deletions

View file

@ -17,10 +17,12 @@ class JsonMessageEnvelope {
JsonReceiptMessage receiptMessage;
public JsonMessageEnvelope(SignalServiceEnvelope envelope, SignalServiceContent content) {
SignalServiceAddress source = envelope.getSourceAddress();
this.source = source.getNumber().get();
if (!envelope.isUnidentifiedSender() && envelope.hasSource()) {
SignalServiceAddress source = envelope.getSourceAddress();
this.source = source.getNumber().get();
this.relay = source.getRelay().isPresent() ? source.getRelay().get() : null;
}
this.sourceDevice = envelope.getSourceDevice();
this.relay = source.getRelay().isPresent() ? source.getRelay().get() : null;
this.timestamp = envelope.getTimestamp();
this.isReceipt = envelope.isReceipt();
if (content != null) {