Add channel message filter for spam and repeated messages

Client-side filter for channel messages, with no model download:
- User rules on message text and/or sender name (contains, whole word,
  exact), normalised for case, accents, zero-width and look-alike letters.
- Automatic checks: repeated characters, same-sender repeats within 10
  minutes, and the same sentence (>= 6 words) from 3+ senders within 30
  minutes. Windows use send times, so synced history is not a flood.
- On-device n-gram classifier trained by Mark as spam / Not spam taps.

Filtered messages are kept, never notify or count as unread, are not
auto-translated or used for channel previews, and are concealed in reply
quotes. They show as a calm, collapsible placeholder that animates open
and closed, or can be hidden completely. Includes a Filtered messages
list, per-channel toggle, settings screen, translations for all locales
and documentation.
This commit is contained in:
zjs81 committed 2026-11-05 23:35:27 -07:00
1 parent 5ef2c2cd7d
commit 1332c35884
75 files changed
+12527 -254

No files matched your search

+3 -2
View File
@@ -41,6 +41,7 @@ For Linux, use `nix develop`; see [Linux with Nix](README.md#linux-with-nix) for
| Route scoring/history | `lib/services/path_history_service.dart` |
| Preferences and JSON stores | `lib/storage/` |
| Region list and channel/default assignments | `lib/storage/region_store.dart`, `lib/storage/channel_region_store.dart` |
| Message filter (rules, duplicate/spam checks, on-device classifier) | `lib/services/message_filter/`, `lib/models/message_filter.dart`, `lib/storage/message_filter_store.dart`, `lib/screens/message_filter_settings_screen.dart`, `lib/screens/filtered_messages_screen.dart` |
| Translation models/inference | `lib/services/translation_service.dart` |
| Image models/inference and GRP_DATA chunks | `lib/services/image_codec_service.dart`, `lib/services/image_chunk_transport.dart` |
| Image reassembly and file persistence | `lib/services/received_image_store.dart`, `lib/services/received_image_blob_store_io.dart` |
@@ -48,7 +49,7 @@ For Linux, use `nix develop`; see [Linux with Nix](README.md#linux-with-nix) for
| Screens and reusable UI | `lib/screens/`, `lib/widgets/` |
| Localization | `lib/l10n/` (18 locales) |
`Provider`/`ChangeNotifier` drives UI state. `main.dart` wires `MeshTheme.light()` and `MeshTheme.dark()` and uses the saved theme preference. Its `MultiProvider` exposes `MeshCoreConnector`, `MessageRetryService`, `PathHistoryService`, `AppSettingsService`, `BleDebugLogService`, `AppDebugLogService`, `ChatTextScaleService`, `TranslationService`, `UiViewStateService`, `StorageService` (plain `Provider`), `MapTileCacheService`, `TimeoutPredictionService`, `ImageCodecService`, and `ReceivedImageStore`; screens read them with `Consumer<T>`, `context.watch<T>()`, or `context.read<T>()`.
`Provider`/`ChangeNotifier` drives UI state. `main.dart` wires `MeshTheme.light()` and `MeshTheme.dark()` and uses the saved theme preference. Its `MultiProvider` exposes `MeshCoreConnector`, `MessageRetryService`, `PathHistoryService`, `AppSettingsService`, `BleDebugLogService`, `AppDebugLogService`, `ChatTextScaleService`, `TranslationService`, `UiViewStateService`, `StorageService` (plain `Provider`), `MapTileCacheService`, `TimeoutPredictionService`, `ImageCodecService`, `ReceivedImageStore`, and `MessageFilterService`; screens read them with `Consumer<T>`, `context.watch<T>()`, or `context.read<T>()`.
Most JSON stores scope keys by the first 10 hex chars of the connected device's public key, so per-radio data stays isolated; some preferences, including the saved region-name list, are global. Model bundles, received images, and caches use files.
@@ -68,4 +69,4 @@ Android builds currently include ARM64 only and use Java 17. iOS targets 16.4. R
## Documentation
Use the [feature index](documentation/README.md), [regions](documentation/regions.md), [image messages](documentation/image-messages.md), and [routing reference](documentation/routing-paths.md). Keep protocol details in the canonical reference rather than maintaining competing command tables.
Use the [feature index](documentation/README.md), [regions](documentation/regions.md), [image messages](documentation/image-messages.md), [message filter](documentation/message-filter.md), and [routing reference](documentation/routing-paths.md). Keep protocol details in the canonical reference rather than maintaining competing command tables.