Store number/uuid in recipient store after receiving a message

Necessary to find the correct session if the sender send the next message
with only the uuid.

Fixes #309
This commit is contained in:
AsamK 2020-05-22 12:30:36 +02:00
parent b382a4260b
commit e048b1886d

View file

@ -1411,6 +1411,11 @@ public class Manager implements Closeable {
System.err.println("Ignoring error: " + e.getMessage()); System.err.println("Ignoring error: " + e.getMessage());
continue; continue;
} }
if (envelope.hasSource()) {
// Store uuid if we don't have it already
SignalServiceAddress source = envelope.getSourceAddress();
resolveSignalServiceAddress(source);
}
if (!envelope.isReceipt()) { if (!envelope.isReceipt()) {
try { try {
content = decryptMessage(envelope); content = decryptMessage(envelope);
@ -1472,6 +1477,9 @@ public class Manager implements Closeable {
} else { } else {
sender = content.getSender(); sender = content.getSender();
} }
// Store uuid if we don't have it already
resolveSignalServiceAddress(sender);
if (content.getDataMessage().isPresent()) { if (content.getDataMessage().isPresent()) {
SignalServiceDataMessage message = content.getDataMessage().get(); SignalServiceDataMessage message = content.getDataMessage().get();