- SignalServiceAddress source = envelope.getSourceAddress();
- this.source = source.getNumber();
- if (this.source.equals("")) {
- this.source = content.getSender();
+ if (!envelope.isUnidentifiedSender() && envelope.hasSource()) {
+ SignalServiceAddress source = envelope.getSourceAddress();
+ this.source = source.getNumber().get();
+ this.relay = source.getRelay().isPresent() ? source.getRelay().get() : null;