From f76df8c3ad73962ceb42084350b0e20c230905b0 Mon Sep 17 00:00:00 2001 From: Pavel Reiter Date: Fri, 16 Aug 2024 14:16:56 +0200 Subject: [PATCH] Publish latest SDK version Publish latest SDK version Version 2.1.1 --- CHANGELOG.md | 8 +++++++- build.gradle | 2 +- .../com/nice/cxonechat/internal/ChatThreadHandlerImpl.kt | 9 +++++++-- .../nice/cxonechat/internal/ChatThreadsHandlerImpl.kt | 4 ++++ readme.md | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6d30de..b5e82a66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ## [Unreleased] + +## [2.1.1] +### Bug Fixes +- CaseStatusChanged with status closed doesn't archive thread in SingleThread mode + ## [2.1.0] ### Bug Fixes @@ -239,7 +244,8 @@ - failure - typing start/end -[Unreleased]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/2.1.0...HEAD +[Unreleased]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/2.1.1...HEAD +[2.1.1]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/2.1.0...2.1.1 [2.1.0]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/2.0.0...2.1.0 [2.0.0]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/1.3.1...2.0.0 [1.3.1]: https://github.com/nice-devone/nice-cxone-mobile-sdk-android/compare/1.3.0...1.3.1 diff --git a/build.gradle b/build.gradle index 781fd0f5..f2aab365 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ plugins { } group = GROUP -version = "2.1.0" // Fallback version +version = "2.1.1" // Fallback version allprojects { group = rootProject.group diff --git a/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadHandlerImpl.kt b/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadHandlerImpl.kt index 529d0ddf..a43d7e72 100644 --- a/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadHandlerImpl.kt +++ b/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadHandlerImpl.kt @@ -17,6 +17,7 @@ package com.nice.cxonechat.internal import com.nice.cxonechat.Cancellable import com.nice.cxonechat.ChatFieldHandler +import com.nice.cxonechat.ChatMode.SingleThread import com.nice.cxonechat.ChatThreadEventHandler import com.nice.cxonechat.ChatThreadHandler import com.nice.cxonechat.ChatThreadHandler.OnThreadUpdatedListener @@ -55,8 +56,12 @@ internal class ChatThreadHandlerImpl( val onUpdated = chat.socketListener.addCallback(EventThreadUpdated) { listener.onUpdated(thread) } - val onArchived = chat.socketListener.addCallback(EventCaseStatusChanged) { event -> - CaseStatusChangedHandlerActions.handleCaseClosed(thread, event, listener::onUpdated) + val onArchived = if (chat.chatMode !== SingleThread) { + chat.socketListener.addCallback(EventCaseStatusChanged) { event -> + CaseStatusChangedHandlerActions.handleCaseClosed(thread, event, listener::onUpdated) + } + } else { + Cancellable.noop } return Cancellable(onRecovered, onUpdated, onArchived) } diff --git a/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadsHandlerImpl.kt b/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadsHandlerImpl.kt index 497918ee..db0a2661 100644 --- a/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadsHandlerImpl.kt +++ b/chat-sdk-core/src/main/java/com/nice/cxonechat/internal/ChatThreadsHandlerImpl.kt @@ -18,6 +18,7 @@ package com.nice.cxonechat.internal import com.nice.cxonechat.Cancellable import com.nice.cxonechat.ChatMode.LiveChat import com.nice.cxonechat.ChatMode.MultiThread +import com.nice.cxonechat.ChatMode.SingleThread import com.nice.cxonechat.ChatThreadHandler import com.nice.cxonechat.ChatThreadsHandler import com.nice.cxonechat.internal.model.ChatThreadInternal @@ -75,6 +76,9 @@ internal class ChatThreadsHandlerImpl( threads = event.threads.map { threadData -> threadData.toChatThread().asMutable() } listener.onThreadsUpdated(threads) } + if (chat.chatMode === SingleThread) { + return threadListFetched + } val threadArchived = chat.socketListener.addCallback(EventCaseStatusChanged) { event -> threads.asSequence() .filter(event::inThread) diff --git a/readme.md b/readme.md index eaf830af..13b21466 100644 --- a/readme.md +++ b/readme.md @@ -50,7 +50,7 @@ You can use any uprivilidged valid token, since the package are public. Then you can the dependency simply by adding: ```groovy - implementation "com.nice.cxone:chat-sdk-core:1.3.1" + implementation "com.nice.cxone:chat-sdk-core:2.1.1" ``` ### Additional information