From 21606bc9c1c9b7579042617b35d0f15b5ad685c1 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Mon, 6 Mar 2023 17:19:34 +0100 Subject: [PATCH] Make setReadMarker parameter boolean Signed-off-by: Marcel Hibbe --- .../nextcloud/talk/controllers/ChatController.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 2f58971e3..61d9f9784 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -2016,7 +2016,7 @@ class ChatController(args: Bundle) : if (isFirstMessagesProcessing) { pullChatMessages(false) } else { - pullChatMessages(true, 0) + pullChatMessages(true, false) } if (webSocketInstance != null) { @@ -2234,7 +2234,7 @@ class ChatController(args: Bundle) : } } - fun pullChatMessages(lookIntoFuture: Boolean, setReadMarker: Int = 1, xChatLastCommonRead: Int? = null) { + fun pullChatMessages(lookIntoFuture: Boolean, setReadMarker: Boolean = true, xChatLastCommonRead: Int? = null) { if (!validSessionId()) { return } @@ -2277,7 +2277,12 @@ class ChatController(args: Bundle) : } fieldMap["limit"] = MESSAGE_PULL_LIMIT - fieldMap["setReadMarker"] = setReadMarker + + if (setReadMarker) { + fieldMap["setReadMarker"] = 1 + } else { + fieldMap["setReadMarker"] = 0 + } val lastKnown = if (lookIntoFuture) { globalLastKnownFutureMessageId @@ -2457,7 +2462,7 @@ class ChatController(args: Bundle) : adapter?.notifyDataSetChanged() if (validSessionId()) { - pullChatMessages(true, 1, xChatLastCommonRead) + pullChatMessages(true, true, xChatLastCommonRead) } }