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:
parent
1e3f5e5933
commit
14dc9ce860
2 changed files with 3 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed missing notifications in some cases ([#159])
|
- Fixed missing notifications in some cases ([#159])
|
||||||
|
- Fixed incorrect blocking of MMS messages in some rare cases ([#644])
|
||||||
|
|
||||||
## [1.7.0] - 2025-12-16
|
## [1.7.0] - 2025-12-16
|
||||||
### Added
|
### 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
|
[#574]: https://github.com/FossifyOrg/Messages/issues/574
|
||||||
[#600]: https://github.com/FossifyOrg/Messages/issues/600
|
[#600]: https://github.com/FossifyOrg/Messages/issues/600
|
||||||
[#610]: https://github.com/FossifyOrg/Messages/issues/610
|
[#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
|
[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
|
[1.7.0]: https://github.com/FossifyOrg/Messages/compare/1.6.0...1.7.0
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import com.klinker.android.send_message.MmsReceivedReceiver
|
||||||
import org.fossify.commons.extensions.baseConfig
|
import org.fossify.commons.extensions.baseConfig
|
||||||
import org.fossify.commons.extensions.getMyContactsCursor
|
import org.fossify.commons.extensions.getMyContactsCursor
|
||||||
import org.fossify.commons.extensions.isNumberBlocked
|
import org.fossify.commons.extensions.isNumberBlocked
|
||||||
import org.fossify.commons.extensions.normalizePhoneNumber
|
|
||||||
import org.fossify.commons.extensions.showErrorToast
|
import org.fossify.commons.extensions.showErrorToast
|
||||||
import org.fossify.commons.helpers.SimpleContactsHelper
|
import org.fossify.commons.helpers.SimpleContactsHelper
|
||||||
import org.fossify.commons.helpers.ensureBackgroundThread
|
import org.fossify.commons.helpers.ensureBackgroundThread
|
||||||
|
|
@ -27,8 +26,7 @@ import org.fossify.messages.models.Message
|
||||||
class MmsReceiver : MmsReceivedReceiver() {
|
class MmsReceiver : MmsReceivedReceiver() {
|
||||||
|
|
||||||
override fun isAddressBlocked(context: Context, address: String): Boolean {
|
override fun isAddressBlocked(context: Context, address: String): Boolean {
|
||||||
val normalizedAddress = address.normalizePhoneNumber()
|
if (context.isNumberBlocked(address)) return true
|
||||||
if (context.isNumberBlocked(normalizedAddress)) return true
|
|
||||||
if (context.baseConfig.blockUnknownNumbers) {
|
if (context.baseConfig.blockUnknownNumbers) {
|
||||||
context.getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true).use {
|
context.getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true).use {
|
||||||
val isKnownContact = SimpleContactsHelper(context).existsSync(address, it)
|
val isKnownContact = SimpleContactsHelper(context).existsSync(address, it)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue