Add an option to only accept messages from contacts - #2
Closed
wanderwildwood wants to merge 1 commit into
Closed
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.