Fix handling data messages of sync messages

This commit is contained in:
AsamK 2020-12-24 18:05:12 +01:00
parent e11e020886
commit ff998fce57

View file

@ -1621,7 +1621,7 @@ public class Manager implements Closeable {
} }
final SignalServiceAddress conversationPartnerAddress = isSync ? destination : source; final SignalServiceAddress conversationPartnerAddress = isSync ? destination : source;
if (message.isEndSession()) { if (conversationPartnerAddress != null && message.isEndSession()) {
handleEndSession(conversationPartnerAddress); handleEndSession(conversationPartnerAddress);
} }
if (message.isExpirationUpdate() || message.getBody().isPresent()) { if (message.isExpirationUpdate() || message.getBody().isPresent()) {
@ -1638,7 +1638,7 @@ public class Manager implements Closeable {
} else if (message.getGroupContext().get().getGroupV2().isPresent()) { } else if (message.getGroupContext().get().getGroupV2().isPresent()) {
// disappearing message timer already stored in the DecryptedGroup // disappearing message timer already stored in the DecryptedGroup
} }
} else { } else if (conversationPartnerAddress != null) {
ContactInfo contact = account.getContactStore().getContact(conversationPartnerAddress); ContactInfo contact = account.getContactStore().getContact(conversationPartnerAddress);
if (contact == null) { if (contact == null) {
contact = new ContactInfo(conversationPartnerAddress); contact = new ContactInfo(conversationPartnerAddress);
@ -2025,13 +2025,11 @@ public class Manager implements Closeable {
if (syncMessage.getSent().isPresent()) { if (syncMessage.getSent().isPresent()) {
SentTranscriptMessage message = syncMessage.getSent().get(); SentTranscriptMessage message = syncMessage.getSent().get();
final SignalServiceAddress destination = message.getDestination().orNull(); final SignalServiceAddress destination = message.getDestination().orNull();
if (destination != null) { actions.addAll(handleSignalServiceDataMessage(message.getMessage(),
actions.addAll(handleSignalServiceDataMessage(message.getMessage(), true,
true, sender,
sender, destination,
destination, ignoreAttachments));
ignoreAttachments));
}
} }
if (syncMessage.getRequest().isPresent()) { if (syncMessage.getRequest().isPresent()) {
RequestMessage rm = syncMessage.getRequest().get(); RequestMessage rm = syncMessage.getRequest().get();