Fix false repeat flags, add repeat-sends setting, limit holiday animations
Message filter: - Ignore copies of a message already seen (same sender, text and send second). Switching between companions re-synced messages the first one had delivered; they missed per-radio storage dedup and were flagged as repeats. - Exempt replies and @[name] mentions from repeat detection. - New "Sends to count as a repeat" setting (2-5, default 2). Each send must fall within 10 minutes of the previous one. - Translations for the new strings in all locales. Holiday animations: - Only one plays at a time; greetings arriving while one is playing or within 5 seconds after it ends are dropped, not queued. - Christmas map "self" marker: Santa hat was upside down.
This commit is contained in:
1 parent
59e571fb20
commit
ddf0b9f553
52 files changed
+526
-24
No files matched your search
@@ -143,6 +143,10 @@ class MessageFilterSettings {
|
||||
final bool enabled;
|
||||
final FilterDisplayMode displayMode;
|
||||
final bool duplicates;
|
||||
|
||||
/// Which send in a row of the same message by the same sender is flagged
|
||||
/// as a repeat (2 = the first re-send).
|
||||
final int repeatSends;
|
||||
final bool repeatedCharacters;
|
||||
final bool learning;
|
||||
final Set<String> excludedChannelIds;
|
||||
@@ -151,6 +155,7 @@ class MessageFilterSettings {
|
||||
this.enabled = true,
|
||||
this.displayMode = FilterDisplayMode.placeholder,
|
||||
this.duplicates = true,
|
||||
this.repeatSends = defaultRepeatSends,
|
||||
this.repeatedCharacters = true,
|
||||
this.learning = true,
|
||||
this.excludedChannelIds = const <String>{},
|
||||
@@ -158,10 +163,15 @@ class MessageFilterSettings {
|
||||
|
||||
static const MessageFilterSettings defaults = MessageFilterSettings();
|
||||
|
||||
static const int defaultRepeatSends = 2;
|
||||
static const int minRepeatSends = 2;
|
||||
static const int maxRepeatSends = 5;
|
||||
|
||||
MessageFilterSettings copyWith({
|
||||
bool? enabled,
|
||||
FilterDisplayMode? displayMode,
|
||||
bool? duplicates,
|
||||
int? repeatSends,
|
||||
bool? repeatedCharacters,
|
||||
bool? learning,
|
||||
Set<String>? excludedChannelIds,
|
||||
@@ -170,6 +180,7 @@ class MessageFilterSettings {
|
||||
enabled: enabled ?? this.enabled,
|
||||
displayMode: displayMode ?? this.displayMode,
|
||||
duplicates: duplicates ?? this.duplicates,
|
||||
repeatSends: repeatSends ?? this.repeatSends,
|
||||
repeatedCharacters: repeatedCharacters ?? this.repeatedCharacters,
|
||||
learning: learning ?? this.learning,
|
||||
excludedChannelIds: excludedChannelIds ?? this.excludedChannelIds,
|
||||
@@ -180,6 +191,7 @@ class MessageFilterSettings {
|
||||
'enabled': enabled,
|
||||
'displayMode': displayMode.name,
|
||||
'duplicates': duplicates,
|
||||
'repeatSends': repeatSends,
|
||||
'repeatedCharacters': repeatedCharacters,
|
||||
'learning': learning,
|
||||
'excludedChannelIds': excludedChannelIds.toList()..sort(),
|
||||
@@ -195,6 +207,11 @@ class MessageFilterSettings {
|
||||
FilterDisplayMode.placeholder,
|
||||
),
|
||||
duplicates: json['duplicates'] as bool? ?? true,
|
||||
repeatSends:
|
||||
((json['repeatSends'] as num?)?.toInt() ?? defaultRepeatSends).clamp(
|
||||
minRepeatSends,
|
||||
maxRepeatSends,
|
||||
),
|
||||
repeatedCharacters: json['repeatedCharacters'] as bool? ?? true,
|
||||
learning: json['learning'] as bool? ?? true,
|
||||
excludedChannelIds: excluded is List
|
||||
|
||||
Reference in new issue
Block a user