Fix ratcheting bug

This commit is contained in:
Niels Andriesse 2019-08-06 09:46:43 +10:00
parent 93b7472e25
commit 3a5f5a9a41

View File

@ -111,7 +111,6 @@ import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSy
import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage; import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage;
import org.whispersystems.signalservice.api.messages.shared.SharedContact; import org.whispersystems.signalservice.api.messages.shared.SharedContact;
import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.loki.api.LokiGroupChatAPI;
import org.whispersystems.signalservice.loki.crypto.LokiServiceCipher; import org.whispersystems.signalservice.loki.crypto.LokiServiceCipher;
import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus; import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus;
import org.whispersystems.signalservice.loki.messaging.LokiServiceMessage; import org.whispersystems.signalservice.loki.messaging.LokiServiceMessage;
@ -831,13 +830,10 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
} }
Long threadId; Long threadId;
boolean isLokiPublicChatMessage;
if (smsMessageId.isPresent() && !message.getGroupInfo().isPresent()) { if (smsMessageId.isPresent() && !message.getGroupInfo().isPresent()) {
isLokiPublicChatMessage = false;
threadId = database.updateBundleMessageBody(smsMessageId.get(), body).second; threadId = database.updateBundleMessageBody(smsMessageId.get(), body).second;
} else { } else {
isLokiPublicChatMessage = new String(message.getGroupInfo().get().getGroupId()).equals("loki-group-chat-" + LokiGroupChatAPI.getPublicChatID());
notifyTypingStoppedFromIncomingMessage(recipient, content.getSender(), content.getSenderDevice()); notifyTypingStoppedFromIncomingMessage(recipient, content.getSender(), content.getSenderDevice());
IncomingTextMessage textMessage = new IncomingTextMessage(Address.fromSerialized(content.getSender()), IncomingTextMessage textMessage = new IncomingTextMessage(Address.fromSerialized(content.getSender()),
@ -856,7 +852,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
if (smsMessageId.isPresent()) database.deleteMessage(smsMessageId.get()); if (smsMessageId.isPresent()) database.deleteMessage(smsMessageId.get());
} }
if (threadId != null && !isLokiPublicChatMessage) { if (threadId != null) {
MessageNotifier.updateNotification(context, threadId); MessageNotifier.updateNotification(context, threadId);
} }
} }