Do not save local room into recent rooms

This commit is contained in:
Florian Renaud 2022-09-16 09:23:14 +02:00
parent 830e5ffa9f
commit 3c68222fd7
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package org.matrix.android.sdk.internal.session.user.accountdata package org.matrix.android.sdk.internal.session.user.accountdata
import com.zhuinden.monarchy.Monarchy 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.model.BreadcrumbsEntity
import org.matrix.android.sdk.internal.database.query.get import org.matrix.android.sdk.internal.database.query.get
import org.matrix.android.sdk.internal.di.SessionDatabase import org.matrix.android.sdk.internal.di.SessionDatabase
@ -41,6 +42,8 @@ internal class DefaultUpdateBreadcrumbsTask @Inject constructor(
) : UpdateBreadcrumbsTask { ) : UpdateBreadcrumbsTask {
override suspend fun execute(params: UpdateBreadcrumbsTask.Params) { 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 = val newBreadcrumbs =
// Get the breadcrumbs entity, if any // Get the breadcrumbs entity, if any
monarchy.fetchCopied { BreadcrumbsEntity.get(it) } monarchy.fetchCopied { BreadcrumbsEntity.get(it) }