Do not support searching in multiple rooms for now.

This commit is contained in:
Onuray Sahin 2020-09-17 12:25:07 +03:00 committed by Benoit Marty
parent 05f48255a3
commit 2eb60213b4
3 changed files with 6 additions and 6 deletions

View File

@ -30,7 +30,7 @@ interface SearchService {
* Generic function to search a term in multiple rooms.
* Ref: https://matrix.org/docs/spec/client_server/latest#module-search
* @param searchTerm the term to search
* @param rooms roomIds to search term inside
* @param roomId the roomId to search term inside
* @param nextBatch the token that retrieved from the previous response. Should be provided to get the next batch of results
* @param limit the maximum number of events to return.
* @param beforeLimit how many events before the result are returned.
@ -38,7 +38,7 @@ interface SearchService {
* @param includeProfile requests that the server returns the historic profile information for the users that sent the events that were returned.
*/
fun search(searchTerm: String,
rooms: List<String>,
roomId: String,
nextBatch: String?,
orderByRecent: Boolean,
limit: Int,

View File

@ -31,7 +31,7 @@ internal class DefaultSearchService @Inject constructor(
) : SearchService {
override fun search(searchTerm: String,
rooms: List<String>,
roomId: String,
nextBatch: String?,
orderByRecent: Boolean,
limit: Int,
@ -42,7 +42,7 @@ internal class DefaultSearchService @Inject constructor(
return searchTask
.configureWith(SearchTask.Params(
searchTerm = searchTerm,
rooms = rooms,
roomId = roomId,
nextBatch = nextBatch,
orderByRecent = orderByRecent,
limit = limit,

View File

@ -34,7 +34,7 @@ internal interface SearchTask : Task<SearchTask.Params, SearchResponse> {
data class Params(
val searchTerm: String,
val rooms: List<String>,
val roomId: String,
val nextBatch: String? = null,
val orderByRecent: Boolean,
val limit: Int,
@ -58,7 +58,7 @@ internal class DefaultSearchTask @Inject constructor(
orderBy = if (params.orderByRecent) SearchRequestOrder.RECENT else SearchRequestOrder.RANK,
filter = SearchRequestFilter(
limit = params.limit,
rooms = params.rooms
rooms = listOf(params.roomId)
),
eventContext = SearchRequestEventContext(
beforeLimit = params.beforeLimit,