From 93e1cd7756993ce9025eed3ad456a4bcec2f0907 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 24 Jan 2020 09:59:37 +1100 Subject: [PATCH] Fix public chat deletion --- .../securesms/loki/redesign/activities/HomeActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/loki/redesign/activities/HomeActivity.kt b/src/org/thoughtcrime/securesms/loki/redesign/activities/HomeActivity.kt index db2e7676ab..798528dbbe 100644 --- a/src/org/thoughtcrime/securesms/loki/redesign/activities/HomeActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/redesign/activities/HomeActivity.kt @@ -202,11 +202,14 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe override fun run() { AsyncTask.execute { - threadDatabase.deleteConversation(threadID) val publicChat = DatabaseFactory.getLokiThreadDatabase(activity).getPublicChat(threadID) if (publicChat != null) { + val apiDatabase = DatabaseFactory.getLokiAPIDatabase(activity) + apiDatabase.removeLastMessageServerID(publicChat.channel, publicChat.server) + apiDatabase.removeLastDeletionServerID(publicChat.channel, publicChat.server) ApplicationContext.getInstance(activity).lokiPublicChatAPI!!.leave(publicChat.channel, publicChat.server) } + threadDatabase.deleteConversation(threadID) MessageNotifier.updateNotification(activity) } }