build: updated to 179 layer #56

Merged
teidesu merged 13 commits from layer179 into master 2024-05-06 12:28:14 +03:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit e8a09ec270 - Show all commits

View file

@ -33,7 +33,7 @@ export async function* iterSearchGlobal(
): AsyncIterableIterator<Message> {
if (!params) params = {}
const { query = '', filter = SearchFilters.Empty, limit = Infinity, chunkSize = 100 } = params
const { query = '', filter = SearchFilters.Empty, limit = Infinity, chunkSize = 100, onlyChannels } = params
const minDate = normalizeDate(params.minDate) ?? 0
const maxDate = normalizeDate(params.maxDate) ?? 0
@ -49,6 +49,7 @@ export async function* iterSearchGlobal(
minDate,
maxDate,
offset,
onlyChannels,
})
if (!res.length) return

View file

@ -63,6 +63,11 @@ export async function searchGlobal(
* Only return messages older than this date
*/
maxDate?: Date | number
/**
* Whether to only search across broadcast channels
*/
onlyChannels?: boolean
},
): Promise<ArrayPaginated<Message, SearchGlobalOffset>> {
if (!params) params = {}
@ -72,6 +77,7 @@ export async function searchGlobal(
filter = SearchFilters.Empty,
limit = 100,
offset: { rate: offsetRate, peer: offsetPeer, id: offsetId } = defaultOffset,
onlyChannels,
} = params
const minDate = normalizeDate(params.minDate) ?? 0
@ -87,6 +93,7 @@ export async function searchGlobal(
offsetRate,
offsetPeer,
limit,
broadcastsOnly: onlyChannels,
})
assertTypeIsNot('searchGlobal', res, 'messages.messagesNotModified')