fix: disable address normalization when checking blocked MMS senders (#644)

Removed MMS sender address normalization when checking against blocked numbers. Previously, blocking an alphanumeric address such as `VE-ViCARE` would block MMS messages from `VE-ViCARE` and the normalized number `83842273`. Even if that collision never occurs in the real world, removing normalization is the correct move and is consistent with how SMS blocking works.
This commit is contained in:
Naveen Singh 2025-12-21 16:01:53 +05:30 committed by GitHub
parent 1e3f5e5933
commit 14dc9ce860
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Fixed missing notifications in some cases ([#159])
- Fixed incorrect blocking of MMS messages in some rare cases ([#644])
## [1.7.0] - 2025-12-16
### Added
@ -221,6 +222,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#574]: https://github.com/FossifyOrg/Messages/issues/574
[#600]: https://github.com/FossifyOrg/Messages/issues/600
[#610]: https://github.com/FossifyOrg/Messages/issues/610
[#644]: https://github.com/FossifyOrg/Messages/issues/644
[Unreleased]: https://github.com/FossifyOrg/Messages/compare/1.7.0...HEAD
[1.7.0]: https://github.com/FossifyOrg/Messages/compare/1.6.0...1.7.0

View file

@ -7,7 +7,6 @@ import com.klinker.android.send_message.MmsReceivedReceiver
import org.fossify.commons.extensions.baseConfig
import org.fossify.commons.extensions.getMyContactsCursor
import org.fossify.commons.extensions.isNumberBlocked
import org.fossify.commons.extensions.normalizePhoneNumber
import org.fossify.commons.extensions.showErrorToast
import org.fossify.commons.helpers.SimpleContactsHelper
import org.fossify.commons.helpers.ensureBackgroundThread
@ -27,8 +26,7 @@ import org.fossify.messages.models.Message
class MmsReceiver : MmsReceivedReceiver() {
override fun isAddressBlocked(context: Context, address: String): Boolean {
val normalizedAddress = address.normalizePhoneNumber()
if (context.isNumberBlocked(normalizedAddress)) return true
if (context.isNumberBlocked(address)) return true
if (context.baseConfig.blockUnknownNumbers) {
context.getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true).use {
val isKnownContact = SimpleContactsHelper(context).existsSync(address, it)