mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Add recent search results to global search (#7742)
* Add global search results history: keep the latest 25 items used in the global search, save them to an encrypted file store. * Integrate the search history in the global search feature * Add `MatrixClient.getRoomInfo` and use it in `GlobalSearchPresenter` --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
committed by
GitHub
parent
51fe66cd88
commit
8b1b5560d9
+4
@@ -74,6 +74,7 @@ import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import java.io.File
|
||||
import java.util.Optional
|
||||
import kotlin.jvm.optionals.getOrNull
|
||||
|
||||
class FakeMatrixClient(
|
||||
override val sessionId: SessionId = A_SESSION_ID,
|
||||
@@ -173,6 +174,7 @@ class FakeMatrixClient(
|
||||
var knockRoomLambda: (RoomIdOrAlias, String, List<String>) -> Result<RoomInfo?> = { _, _, _ ->
|
||||
Result.success(null)
|
||||
}
|
||||
var getRoomInfoLambda = { _: RoomId -> Result.success<RoomInfo?>(null) }
|
||||
var getRoomInfoFlowLambda = { _: RoomId ->
|
||||
flowOf<Optional<RoomInfo>>(Optional.empty())
|
||||
}
|
||||
@@ -379,6 +381,8 @@ class FakeMatrixClient(
|
||||
return Result.success(visitedRoomsId)
|
||||
}
|
||||
|
||||
override suspend fun getRoomInfo(roomId: RoomId): Result<RoomInfo?> = getRoomInfoLambda(roomId)
|
||||
|
||||
override fun getRoomInfoFlow(roomId: RoomId) = getRoomInfoFlowLambda(roomId)
|
||||
|
||||
var setAllSendQueuesEnabledLambda = lambdaRecorder(ensureNeverCalled = true) { _: Boolean ->
|
||||
|
||||
Reference in New Issue
Block a user