From 68c1cd6d4d0fc109e70b68a3d73bd6e58a5372f5 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Sun, 22 Mar 2020 11:19:54 +0100 Subject: [PATCH] Fix #684 Signed-off-by: Mario Danic --- app/build.gradle | 4 ++-- .../com/nextcloud/talk/controllers/ChatController.kt | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cb2407bf5..31113dc34 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,8 +39,8 @@ android { targetSdkVersion 28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - versionCode 132 - versionName "8.0.5" + versionCode 133 + versionName "8.0.6" flavorDimensions "default" renderscriptTargetApi 19 diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt index 6b528debb..2ba8bef9d 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -1015,6 +1015,9 @@ class ChatController(args: Bundle) : BaseController(args), MessagesListAdapter if (isFromTheFuture) { globalLastKnownFutureMessageId = header } else { + if (globalLastKnownFutureMessageId == -1) { + globalLastKnownFutureMessageId = header + } globalLastKnownPastMessageId = header } } @@ -1025,8 +1028,6 @@ class ChatController(args: Bundle) : BaseController(args), MessagesListAdapter val chatOverall = response.body() as ChatOverall? val chatMessageList = chatOverall?.ocs!!.data - val wasFirstMessageProcessing = isFirstMessagesProcessing - if (isFirstMessagesProcessing) { cancelNotificationsForCurrentConversation() @@ -1061,10 +1062,6 @@ class ChatController(args: Bundle) : BaseController(args), MessagesListAdapter } - if (wasFirstMessageProcessing && chatMessageList.size > 0) { - globalLastKnownFutureMessageId = chatMessageList[0].jsonMessageId - } - if (adapter != null) { adapter?.addToEnd(chatMessageList, false) }