From e2e6ef8761341814f649b0bea186b7ced4ecdc2b Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 1 Oct 2020 15:21:12 +1000 Subject: [PATCH] Generate own ratchet if needed --- .../securesms/loki/protocol/ClosedGroupsProtocol.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt index d057970bd5..8b52e47601 100644 --- a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt @@ -400,10 +400,7 @@ object ClosedGroupsProtocol { Log.d("Loki", "Responding to sender key request from: $senderPublicKey.") ApplicationContext.getInstance(context).sendSessionRequestIfNeeded(senderPublicKey) val userRatchet = DatabaseFactory.getSSKDatabase(context).getClosedGroupRatchet(groupPublicKey, userPublicKey) - if (userRatchet == null) { - Log.d("Loki", "Missing own ratchet.") - return - } + ?: SharedSenderKeysImplementation.shared.generateRatchet(groupPublicKey, userPublicKey) val userSenderKey = ClosedGroupSenderKey(Hex.fromStringCondensed(userRatchet.chainKey), userRatchet.keyIndex, Hex.fromStringCondensed(userPublicKey)) val closedGroupUpdateKind = ClosedGroupUpdateMessageSendJob.Kind.SenderKey(Hex.fromStringCondensed(groupPublicKey), userSenderKey) val job = ClosedGroupUpdateMessageSendJob(senderPublicKey, closedGroupUpdateKind)