fix: don't limit search to 32bit ints (#378)

* fix: don't limit search to 32bit ints

This is a quick fix. Will do a proper rewrite later.

Refs: https://github.com/FossifyOrg/General-Discussion/issues/718

* docs: update changelog
This commit is contained in:
Naveen Singh
2025-09-29 17:30:30 +05:30
committed by GitHub
parent 5be83eeae3
commit bbb68d39fe
2 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed search not matching full phone numbers
## [1.2.5] - 2025-09-09
### Changed

View File

@@ -315,7 +315,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
val filtered = contactsIgnoringSearch.filter {
getProperText(it.getNameToDisplay(), shouldNormalize).contains(fixedText, true) ||
getProperText(it.nickname, shouldNormalize).contains(fixedText, true) ||
(fixedText.toIntOrNull() != null && it.phoneNumbers.any {
(fixedText.toLongOrNull() != null && it.phoneNumbers.any {
fixedText.normalizePhoneNumber().isNotEmpty() && it.normalizedNumber.contains(fixedText.normalizePhoneNumber(), true)
}) ||
it.emails.any { it.value.contains(fixedText, true) } ||
@@ -339,7 +339,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
}
innerBinding.fragmentPlaceholder.beVisibleIf(filtered.isEmpty())
(adapter as? ContactsAdapter)?.updateItems(filtered, fixedText.normalizeString())
adapter.updateItems(filtered, fixedText.normalizeString())
setupLetterFastscroller(filtered)
} else if (adapter is GroupsAdapter) {
val filtered = groupsIgnoringSearch.filter {
@@ -351,7 +351,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
}
innerBinding.fragmentPlaceholder.beVisibleIf(filtered.isEmpty())
(adapter as? GroupsAdapter)?.updateItems(filtered, text)
adapter.updateItems(filtered, text)
}
}