From 83189ce717c64108fadff03fa59a36cb2a36cbd8 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:48:34 +1100 Subject: [PATCH] Clear messages if user is kicked --- .../thoughtcrime/securesms/groups/GroupManagerV2Impl.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt b/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt index d030e5bb7b..2c94f4243c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt @@ -813,6 +813,13 @@ class GroupManagerV2Impl @Inject constructor( ) } + // Clear all messages we have from the group + val threadId = storage.getThreadId(Address.fromSerialized(groupId.hexString)) + if (threadId != null) { + storage.clearMessages(threadId) + } + + // Insert a message to indicate we were kicked storage.insertIncomingInfoMessage( context = application, senderPublicKey = userId,