From 308dafcdc4739271e42285e479f31378f289b4fd Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Wed, 23 Sep 2020 15:25:51 +1000 Subject: [PATCH] remove the ratchet for only the group that the use left --- .../securesms/loki/database/SharedSenderKeysDatabase.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/loki/database/SharedSenderKeysDatabase.kt b/src/org/thoughtcrime/securesms/loki/database/SharedSenderKeysDatabase.kt index 15b415e8e0..548e717011 100644 --- a/src/org/thoughtcrime/securesms/loki/database/SharedSenderKeysDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/database/SharedSenderKeysDatabase.kt @@ -58,7 +58,8 @@ class SharedSenderKeysDatabase(context: Context, helper: SQLCipherOpenHelper) : override fun removeAllClosedGroupRatchets(groupPublicKey: String) { val database = databaseHelper.writableDatabase - database.delete(closedGroupRatchetTable, null, null) + val query = "${Companion.closedGroupPublicKey} = ?" + database.delete(closedGroupRatchetTable, query, arrayOf( groupPublicKey )) } override fun getAllClosedGroupSenderKeys(groupPublicKey: String): Set {