From 33e77dde1e762cb940db66377e80e90a9c9ae45b Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 17 May 2021 13:46:17 +1000 Subject: [PATCH] Fix group deletion --- .../thoughtcrime/securesms/loki/api/PublicChatManager.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/api/PublicChatManager.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/api/PublicChatManager.kt index c270797c6c..70bb78d8b6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/api/PublicChatManager.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/api/PublicChatManager.kt @@ -150,9 +150,10 @@ class PublicChatManager(private val context: Context) { val groupId = "$server.$room" val threadId = GroupManager.getOpenGroupThreadID(groupId, context) val groupAddress = threadDB.getRecipientForThreadId(threadId)!!.address.serialize() - GroupManager.deleteGroup(groupAddress, context) - - Util.runOnMain { startPollersIfNeeded() } + ThreadUtils.queue { + GroupManager.deleteGroup(groupAddress, context) // Must be invoked on a background thread + Util.runOnMain { startPollersIfNeeded() } + } } private fun refreshChatsAndPollers() {