Searching: Remove the func suffix from our search functions.

This commit is contained in:
Damir Jelić 2019-11-18 10:56:57 +01:00
parent a4ad8151f8
commit 0e3a0008df

View file

@ -35,11 +35,11 @@ function serverSideSearch(term, roomId = undefined) {
return searchPromise; return searchPromise;
} }
async function combinedSearchFunc(searchTerm) { async function combinedSearch(searchTerm) {
// Create two promises, one for the local search, one for the // Create two promises, one for the local search, one for the
// server-side search. // server-side search.
const serverSidePromise = serverSideSearch(searchTerm); const serverSidePromise = serverSideSearch(searchTerm);
const localPromise = localSearchFunc(searchTerm); const localPromise = localSearch(searchTerm);
// Wait for both promises to resolve. // Wait for both promises to resolve.
await Promise.all([serverSidePromise, localPromise]); await Promise.all([serverSidePromise, localPromise]);
@ -74,7 +74,7 @@ async function combinedSearchFunc(searchTerm) {
return result; return result;
} }
async function localSearchFunc(searchTerm, roomId = undefined) { async function localSearch(searchTerm, roomId = undefined) {
const searchArgs = { const searchArgs = {
search_term: searchTerm, search_term: searchTerm,
before_limit: 1, before_limit: 1,
@ -115,7 +115,7 @@ function eventIndexSearch(term, roomId = undefined) {
if (MatrixClientPeg.get().isRoomEncrypted(roomId)) { if (MatrixClientPeg.get().isRoomEncrypted(roomId)) {
// The search is for a single encrypted room, use our local // The search is for a single encrypted room, use our local
// search method. // search method.
searchPromise = localSearchFunc(term, roomId); searchPromise = localSearch(term, roomId);
} else { } else {
// The search is for a single non-encrypted room, use the // The search is for a single non-encrypted room, use the
// server-side search. // server-side search.
@ -124,7 +124,7 @@ function eventIndexSearch(term, roomId = undefined) {
} else { } else {
// Search across all rooms, combine a server side search and a // Search across all rooms, combine a server side search and a
// local search. // local search.
searchPromise = combinedSearchFunc(term); searchPromise = combinedSearch(term);
} }
return searchPromise; return searchPromise;