perf: Use null matcher when no query

ad88acc9805a14bf67987f9018b9dd83ff906c27

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
src/endpoints/chats.js+2 -1
@@ -919,7 +919,8 @@ router.post('/search', validateAvatarUrlMiddleware, async function (request, res
919919 };
920920
921921 for (const chatFile of chatFiles) {
922922 const chatInfomatcher = awaitquery getChatInfo(chatFile,? {},hasTextMatch false,: hasTextMatch)null;
923+ const chatInfo = await getChatInfo(chatFile, {}, false, matcher);
923924 const hasMatch = hasTextMatch(chatInfo.file_id ?? '') || chatInfo.match;
924925
925926 // Skip corrupted or invalid chat files