From 54f381e2a78d7a616ffe15ba16a76ced754454aa Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:39:28 +1100 Subject: [PATCH] Fix poller unable to start when approving group invite (#888) --- .../securesms/groups/GroupManagerV2Impl.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 bdfaa029cc..b1002466f9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt @@ -638,6 +638,14 @@ class GroupManagerV2Impl @Inject constructor( "Our account ID is not available" } + // Clear the invited flag of the group in the config + configFactory.withMutableUserConfigs { configs -> + configs.userGroups.set(group.copy( + invited = false, + joinedAtSecs = TimeUnit.MILLISECONDS.toSeconds(clock.currentTimeMills()) + )) + } + val poller = checkNotNull(pollerFactory.pollerFor(group.groupAccountId)) { "Unable to start a poller for groups " } poller.start() @@ -649,13 +657,6 @@ class GroupManagerV2Impl @Inject constructor( .filter { it.hadAtLeastOneSuccessfulPoll } .first() } - // Clear the invited flag of the group in the config - configFactory.withMutableUserConfigs { configs -> - configs.userGroups.set(group.copy( - invited = false, - joinedAtSecs = TimeUnit.MILLISECONDS.toSeconds(clock.currentTimeMills()) - )) - } if (group.adminKey == null) { // Send an invite response to the group if we are invited as a regular member