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

+214 -3
View File
@@ -1419,11 +1419,12 @@ class AppLocalizationsIt extends AppLocalizations {
'Mostra altri tipi di nodo sulla mappa';
@override
String get appSettings_showOnlineLinks => 'Show Online Map Connections';
String get appSettings_showOnlineLinks =>
'Mostra connessioni della mappa online';
@override
String get appSettings_showOnlineLinksSubtitle =>
'Display connection lines between nodes from the online map';
'Mostra le linee di collegamento tra i nodi della mappa online';
@override
String get appSettings_timeFilter => 'Filtro Temporale';
@@ -2704,7 +2705,7 @@ class AppLocalizationsIt extends AppLocalizations {
String get map_otherNodes => 'Altri nodi';
@override
String get map_showOnlineLinks => 'Show Online Map Connections';
String get map_showOnlineLinks => 'Mostra connessioni della mappa online';
@override
String get map_showOverlaps => 'Sovrapposizioni chiave ripetitore';
@@ -6859,4 +6860,214 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get holidayGreeting_newYear =>
'Felice Anno Nuovo|Buon Anno Nuovo|Buon Capodanno|Buon Anno|Felice Anno|Felice Capodanno|Happy New Year';
@override
String get messageFilter_title => 'Filtro messaggi';
@override
String get messageFilter_settingsSubtitle =>
'Nascondi spam e messaggi ripetuti';
@override
String get messageFilter_enabled => 'Filtra i messaggi';
@override
String get messageFilter_enabledSubtitle =>
'Si applica ai messaggi dei canali';
@override
String get messageFilter_displayTitle => 'Messaggi filtrati';
@override
String get messageFilter_displayPlaceholder => 'Mostra un piccolo segnaposto';
@override
String get messageFilter_displayHide => 'Nascondi completamente';
@override
String get messageFilter_displayHideHelp =>
'I messaggi nascosti restano nell\'elenco dei messaggi filtrati.';
@override
String get messageFilter_rulesSection => 'Le tue regole';
@override
String get messageFilter_rulesEmpty =>
'Ancora nessuna regola. Aggiungi una parola, una frase o il nome di un mittente per nascondere i messaggi corrispondenti.';
@override
String get messageFilter_addRule => 'Aggiungi regola';
@override
String get messageFilter_editRule => 'Modifica regola';
@override
String get messageFilter_rulePattern => 'Parola, frase o nome';
@override
String get messageFilter_rulePatternHint => 'es. meshos';
@override
String get messageFilter_ruleWhere => 'Cerca in';
@override
String get messageFilter_ruleFieldText => 'Testo del messaggio';
@override
String get messageFilter_ruleFieldSender => 'Nome del mittente';
@override
String get messageFilter_ruleFieldBoth => 'Entrambi';
@override
String get messageFilter_ruleMatch => 'Corrispondenza';
@override
String get messageFilter_ruleMatchContains => 'Contiene';
@override
String get messageFilter_ruleMatchWholeWord => 'Parola intera';
@override
String get messageFilter_ruleMatchExact => 'Esatta';
@override
String get messageFilter_ruleDeleted => 'Regola eliminata';
@override
String get messageFilter_ruleSaved => 'Regola salvata';
@override
String get messageFilter_automaticSection => 'Automatico';
@override
String get messageFilter_duplicates => 'Messaggi ripetuti';
@override
String get messageFilter_duplicatesSubtitle =>
'Lo stesso messaggio inviato di nuovo, o da più mittenti';
@override
String get messageFilter_repeatedCharacters => 'Caratteri ripetuti';
@override
String get messageFilter_repeatedCharactersSubtitle =>
'Messaggi come «aaaaaaaa» o «!!!!!!!!»';
@override
String get messageFilter_learning => 'Impara dai tocchi su Spam';
@override
String messageFilter_learningSubtitle(int spam, int notSpam) {
return '$spam esempi di spam e $notSpam di non spam';
}
@override
String get messageFilter_resetLearning => 'Azzera apprendimento';
@override
String get messageFilter_resetLearningConfirm =>
'Dimenticare tutto ciò che è stato appreso dai tuoi tocchi su Spam e Non spam? Le tue regole vengono mantenute.';
@override
String messageFilter_filteredMessages(int count) {
return 'Messaggi filtrati ($count)';
}
@override
String get messageFilter_filteredMessagesEmpty =>
'Nessun messaggio è stato filtrato.';
@override
String get messageFilter_ghostSingle =>
'Messaggio nascosto · Tocca per vedere';
@override
String messageFilter_ghostMany(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count messaggi nascosti · Tocca per vedere',
one: '$count messaggio nascosto · Tocca per vedere',
);
return '$_temp0';
}
@override
String get messageFilter_ghostSingleExpanded =>
'Messaggio nascosto visibile · Tocca per nascondere';
@override
String messageFilter_ghostManyExpanded(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count messaggi nascosti visibili · Tocca per nascondere',
one: '1 messaggio nascosto visibile · Tocca per nascondere',
);
return '$_temp0';
}
@override
String messageFilter_reasonTextRule(String pattern) {
return 'Filtrato: corrisponde a «$pattern»';
}
@override
String messageFilter_reasonSenderRule(String pattern) {
return 'Filtrato: mittente «$pattern»';
}
@override
String get messageFilter_reasonRepeatedCharacters =>
'Filtrato: caratteri ripetuti';
@override
String get messageFilter_reasonDuplicate => 'Filtrato: messaggio ripetuto';
@override
String get messageFilter_reasonCrossSenderDuplicate =>
'Filtrato: stesso messaggio da più mittenti';
@override
String get messageFilter_reasonLearned =>
'Filtrato: assomiglia ai messaggi che hai segnato come spam';
@override
String get messageFilter_reasonManual =>
'Filtrato: hai segnato questo messaggio come spam';
@override
String get messageFilter_notSpam => 'Non spam';
@override
String get messageFilter_hideAgain => 'Nascondi';
@override
String get messageFilter_markSpam => 'Segna come spam';
@override
String get messageFilter_markedSpam => 'Segnato come spam';
@override
String get messageFilter_markedNotSpam => 'Segnato come non spam';
@override
String get messageFilter_filterSender => 'Filtra questo mittente';
@override
String messageFilter_filterSenderConfirm(String name) {
return 'Nascondere tutti i messaggi di «$name»?';
}
@override
String get messageFilter_filterLikeThis => 'Filtra messaggi come questo…';
@override
String get messageFilter_channelToggle =>
'Filtra i messaggi in questo canale';
@override
String get messageFilter_ghostIconTooltip =>
'Nascosto dal tuo filtro messaggi';
}