private fun createQueryChannelsFilter(filter: FilterObject, searchQuery: String): FilterObject { return if (searchQuery.isNotEmpty()) {Filters.and(Filter,Filters.or(Filters.and( Filters.autocomplete("member.user.name", searchQuery),Filters.notExists("name")),Filters.autocomplete("name", searchQuery)))} else {filter}}
Creates a filter that is used to query channels. If the [searchQuery] is empty, then returns the original [filter] provided by the user. Otherwise, returns a wrapped [filter] that also checks that the channel name match the [searchQuery].