Do not support searching in multiple rooms for now.
This commit is contained in:
parent
05f48255a3
commit
2eb60213b4
@ -30,7 +30,7 @@ interface SearchService {
|
|||||||
* Generic function to search a term in multiple rooms.
|
* Generic function to search a term in multiple rooms.
|
||||||
* Ref: https://matrix.org/docs/spec/client_server/latest#module-search
|
* Ref: https://matrix.org/docs/spec/client_server/latest#module-search
|
||||||
* @param searchTerm the term to 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 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 limit the maximum number of events to return.
|
||||||
* @param beforeLimit how many events before the result are returned.
|
* @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.
|
* @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,
|
fun search(searchTerm: String,
|
||||||
rooms: List<String>,
|
roomId: String,
|
||||||
nextBatch: String?,
|
nextBatch: String?,
|
||||||
orderByRecent: Boolean,
|
orderByRecent: Boolean,
|
||||||
limit: Int,
|
limit: Int,
|
||||||
|
@ -31,7 +31,7 @@ internal class DefaultSearchService @Inject constructor(
|
|||||||
) : SearchService {
|
) : SearchService {
|
||||||
|
|
||||||
override fun search(searchTerm: String,
|
override fun search(searchTerm: String,
|
||||||
rooms: List<String>,
|
roomId: String,
|
||||||
nextBatch: String?,
|
nextBatch: String?,
|
||||||
orderByRecent: Boolean,
|
orderByRecent: Boolean,
|
||||||
limit: Int,
|
limit: Int,
|
||||||
@ -42,7 +42,7 @@ internal class DefaultSearchService @Inject constructor(
|
|||||||
return searchTask
|
return searchTask
|
||||||
.configureWith(SearchTask.Params(
|
.configureWith(SearchTask.Params(
|
||||||
searchTerm = searchTerm,
|
searchTerm = searchTerm,
|
||||||
rooms = rooms,
|
roomId = roomId,
|
||||||
nextBatch = nextBatch,
|
nextBatch = nextBatch,
|
||||||
orderByRecent = orderByRecent,
|
orderByRecent = orderByRecent,
|
||||||
limit = limit,
|
limit = limit,
|
||||||
|
@ -34,7 +34,7 @@ internal interface SearchTask : Task<SearchTask.Params, SearchResponse> {
|
|||||||
|
|
||||||
data class Params(
|
data class Params(
|
||||||
val searchTerm: String,
|
val searchTerm: String,
|
||||||
val rooms: List<String>,
|
val roomId: String,
|
||||||
val nextBatch: String? = null,
|
val nextBatch: String? = null,
|
||||||
val orderByRecent: Boolean,
|
val orderByRecent: Boolean,
|
||||||
val limit: Int,
|
val limit: Int,
|
||||||
@ -58,7 +58,7 @@ internal class DefaultSearchTask @Inject constructor(
|
|||||||
orderBy = if (params.orderByRecent) SearchRequestOrder.RECENT else SearchRequestOrder.RANK,
|
orderBy = if (params.orderByRecent) SearchRequestOrder.RECENT else SearchRequestOrder.RANK,
|
||||||
filter = SearchRequestFilter(
|
filter = SearchRequestFilter(
|
||||||
limit = params.limit,
|
limit = params.limit,
|
||||||
rooms = params.rooms
|
rooms = listOf(params.roomId)
|
||||||
),
|
),
|
||||||
eventContext = SearchRequestEventContext(
|
eventContext = SearchRequestEventContext(
|
||||||
beforeLimit = params.beforeLimit,
|
beforeLimit = params.beforeLimit,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user