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

@ -31,7 +31,7 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
conn.sendSignal(new Signal.ReceiptReceived(
objectPath,
envelope.getTimestamp(),
envelope.getSourceE164().get()
!envelope.isUnidentifiedSender() && envelope.hasSource() ? envelope.getSourceE164().get() : content.getSender().getNumber().get()
));
} catch (DBusException e) {
e.printStackTrace();
@ -55,7 +55,7 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
conn.sendSignal(new Signal.MessageReceived(
objectPath,
message.getTimestamp(),
envelope.isUnidentifiedSender() ? content.getSender().getNumber().get() : envelope.getSourceE164().get(),
envelope.isUnidentifiedSender() || !envelope.hasSource() ? content.getSender().getNumber().get() : envelope.getSourceE164().get(),
message.getGroupInfo().isPresent() ? message.getGroupInfo().get().getGroupId() : new byte[0],
message.getBody().isPresent() ? message.getBody().get() : "",
attachments));