From 3c68222fd70c47b9f544707b7db9834a0cee2cb2 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Fri, 16 Sep 2022 09:23:14 +0200 Subject: [PATCH] Do not save local room into recent rooms --- .../internal/session/user/accountdata/UpdateBreadcrumbsTask.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt index c4ea029cbb..a66a8540e7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt @@ -17,6 +17,7 @@ package org.matrix.android.sdk.internal.session.user.accountdata import com.zhuinden.monarchy.Monarchy +import org.matrix.android.sdk.api.session.room.model.localecho.RoomLocalEcho import org.matrix.android.sdk.internal.database.model.BreadcrumbsEntity import org.matrix.android.sdk.internal.database.query.get import org.matrix.android.sdk.internal.di.SessionDatabase @@ -41,6 +42,8 @@ internal class DefaultUpdateBreadcrumbsTask @Inject constructor( ) : UpdateBreadcrumbsTask { override suspend fun execute(params: UpdateBreadcrumbsTask.Params) { + // Do not add local rooms to the recent rooms list as they should not be known by the server + if (RoomLocalEcho.isLocalEchoId(params.newTopRoomId)) return val newBreadcrumbs = // Get the breadcrumbs entity, if any monarchy.fetchCopied { BreadcrumbsEntity.get(it) }