mirror of https://github.com/vector-im/riot-web
Searching: Always set the limit when searching.
The spec doesn't mention any default limit so different homeservers might use different defaults, since we don't want Riot to behave differently depending on the homeserver bite the bullet of sending an additional 10 or so bytes when searching.pull/21833/head
parent
96ca47381c
commit
46fd36568a
|
@ -22,15 +22,11 @@ const SEARCH_LIMIT = 10;
|
||||||
async function serverSideSearch(term, roomId = undefined, processResult = true) {
|
async function serverSideSearch(term, roomId = undefined, processResult = true) {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
|
|
||||||
let filter;
|
const filter = {
|
||||||
if (roomId !== undefined) {
|
limit: SEARCH_LIMIT,
|
||||||
// XXX: it's unintuitive that the filter for searching doesn't have
|
};
|
||||||
// the same shape as the v2 filter API :(
|
|
||||||
filter = {
|
if (roomId !== undefined) filter.rooms = [roomId];
|
||||||
rooms: [roomId],
|
|
||||||
limit: SEARCH_LIMIT,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
search_categories: {
|
search_categories: {
|
||||||
|
|
Loading…
Reference in New Issue