Skip to content

Commit bbb68d3

Browse files
authored
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: FossifyOrg/General-Discussion#718 * docs: update changelog
1 parent 5be83ee commit bbb68d3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Fixed search not matching full phone numbers
810

911
## [1.2.5] - 2025-09-09
1012
### Changed

app/src/main/kotlin/org/fossify/contacts/fragments/MyViewPagerFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
315315
val filtered = contactsIgnoringSearch.filter {
316316
getProperText(it.getNameToDisplay(), shouldNormalize).contains(fixedText, true) ||
317317
getProperText(it.nickname, shouldNormalize).contains(fixedText, true) ||
318-
(fixedText.toIntOrNull() != null && it.phoneNumbers.any {
318+
(fixedText.toLongOrNull() != null && it.phoneNumbers.any {
319319
fixedText.normalizePhoneNumber().isNotEmpty() && it.normalizedNumber.contains(fixedText.normalizePhoneNumber(), true)
320320
}) ||
321321
it.emails.any { it.value.contains(fixedText, true) } ||
@@ -339,7 +339,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
339339
}
340340

341341
innerBinding.fragmentPlaceholder.beVisibleIf(filtered.isEmpty())
342-
(adapter as? ContactsAdapter)?.updateItems(filtered, fixedText.normalizeString())
342+
adapter.updateItems(filtered, fixedText.normalizeString())
343343
setupLetterFastscroller(filtered)
344344
} else if (adapter is GroupsAdapter) {
345345
val filtered = groupsIgnoringSearch.filter {
@@ -351,7 +351,7 @@ abstract class MyViewPagerFragment<Binding : MyViewPagerFragment.InnerBinding>(c
351351
}
352352

353353
innerBinding.fragmentPlaceholder.beVisibleIf(filtered.isEmpty())
354-
(adapter as? GroupsAdapter)?.updateItems(filtered, text)
354+
adapter.updateItems(filtered, text)
355355
}
356356
}
357357

0 commit comments

Comments
 (0)