From 98f0c1845871a447028efefbc8cb2f50e8889fd5 Mon Sep 17 00:00:00 2001 From: Taras Smakula <tarassmakula@gmail.com> Date: Wed, 14 Dec 2022 15:12:16 +0200 Subject: [PATCH] Fix session remove --- .../java/org/matrix/android/sdk/api/auth/data/Credentials.kt | 2 +- .../android/sdk/internal/auth/DefaultAuthenticationService.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt index c6a9cadf..e3728753 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt @@ -58,6 +58,6 @@ data class Credentials( @Json(name = "well_known") val discoveryInformation: DiscoveryInformation? = null ) -fun Credentials.sessionId(): String { +internal fun Credentials.sessionId(): String { return (if (deviceId.isNullOrBlank()) userId else "$userId|$deviceId").md5() } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt index 050aa8c5..f947b44e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt @@ -495,6 +495,6 @@ internal class DefaultAuthenticationService @Inject constructor( //Added for switch user override fun removeSession(sessionId: String) { - sessionManager.releaseSession(sessionId) + sessionManager.removeSession(sessionId) } } -- GitLab