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,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)