Merge pull request #1622 from ismailnurudeen/fix/deleted_numbers_import

fix: trim whitespace and newline from imported numbers.
This commit is contained in:
Tibor Kaputa 2023-02-16 10:55:04 +01:00 committed by GitHub
commit 3229afbf09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ class BlockedNumbersImporter(
return try {
val inputStream = File(path).inputStream()
val numbers = inputStream.bufferedReader().use {
val content = it.readText().split(BLOCKED_NUMBERS_EXPORT_DELIMITER)
val content = it.readText().trimEnd().split(BLOCKED_NUMBERS_EXPORT_DELIMITER)
content.filter { text -> PhoneNumberUtils.isGlobalPhoneNumber(text) }
}
if (numbers.isNotEmpty()) {