Skip to content

Add an option to only accept messages from contacts - #2

Closed
wanderwildwood wants to merge 1 commit into
lamdanAmiti:masterfrom
wanderwildwood:only-allow-contacts
Closed

Add an option to only accept messages from contacts#2
wanderwildwood wants to merge 1 commit into
lamdanAmiti:masterfrom
wanderwildwood:only-allow-contacts

Conversation

@wanderwildwood

Copy link
Copy Markdown

Closes #1.

@ryran asked for a way to stop a child receiving texts from people who aren't in their contacts. The issue asks for a rebase to pick up SpamBlocker, but a blocklist works backwards for that — it needs you to have already heard from whoever you want to keep out. This is the allow-list version, and it needs no new dependency.

Settings → Blocking → Only allow contacts. Off by default.

The rule sits in QksmsBlockingClient, which already answers the one question the receive workers ask of it, so it covers SMS and MMS through the path they both use. The contacts lookup only runs while the setting is on, so the ordinary case is unchanged.

Three deliberate choices, in case you'd want them differently:

  • isBlacklisted() is untouched. A stranger isn't blacklisted, and the conversation UI uses that call to decide whether to show a thread as blocked — answering yes would mark every unknown sender as though it had been blocked by hand.
  • It does nothing without the contacts permission. Without it every lookup returns "not a contact", so the rule would block the entire inbox — and it would look like the network had gone quiet rather than a setting misfiring. The decision is a pure function so that case has a test.
  • The switch is disabled while a third-party blocking manager is selected, since the rule lives in the built-in client and would otherwise silently do nothing.

Blocked messages still go to the blocked folder rather than being deleted, unless "Drop messages" is also on — for this use case, a message that turns out to matter should be recoverable.

Six tests cover the truth table. Verified on a Mudita Kompakt.

Happy to adjust any of it. I've been keeping a fork current for the Kompakt and would gladly send more upstream if that's useful to you.

Requested in #1: not wanting a child to receive texts from people who are not
in their contacts. The issue asks for a rebase to pick up SpamBlocker, but a
blocklist works backwards for this - it requires having already heard from
whoever you want to keep out. This is the allow-list version, and it does not
need any new dependency.

Settings -> Blocking -> Only allow contacts. Off by default.

The rule sits in QksmsBlockingClient, which already answers the one question
the receive workers ask, so it covers SMS and MMS through the path they both
use. The contacts lookup only runs while the setting is on, so the ordinary
case is unchanged.

Three deliberate choices:

isBlacklisted() is untouched. A stranger is not blacklisted, and the
conversation UI asks that question to decide whether to show a thread as
blocked - answering yes would mark every unknown sender as though it had been
blocked by hand.

It does nothing without the contacts permission. Without it every lookup
returns "not a contact", so the rule would block the entire inbox, and it would
present as the network having gone quiet rather than as a setting misfiring.
The permission is checked alongside the setting, and the decision is a pure
function with a test for exactly that case.

The switch is disabled while a third-party blocking manager is selected, since
the rule lives in the built-in client and would otherwise silently do nothing.

Blocked messages still go to the blocked folder rather than being deleted,
unless "Drop messages" is also on - for the case that prompted this, a message
that turns out to matter should be recoverable.

Six tests cover the truth table. Verified on a Mudita Kompakt.
@wanderwildwood

Copy link
Copy Markdown
Author

@ryran in case it's useful while this sits: I keep a fork current for the Kompakt and this is in it — https://github.com/wanderwildwood/inkmessage-plus/releases/tag/v1.0.12. Same lineage and licence, own application id, so it installs alongside rather than replacing anything. Not trying to pull anyone away from InkMessage; just so you're not stuck waiting.

@wanderwildwood wanderwildwood closed this by deleting the head repository Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✏️ [ FEAT REQ ] rebase in order to bring in updates like SpamBlocker

1 participant