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
@@ -69,8 +69,12 @@ void main() {
|
||||
|
||||
group('HolidayTriggerWatcher', () {
|
||||
late AppSettingsService settings;
|
||||
late DateTime now;
|
||||
|
||||
setUp(() async {
|
||||
now = DateTime(2026, 12, 25, 12);
|
||||
holidayAnimationClock = () => now;
|
||||
resetHolidayAnimationGate();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
await PrefsManager.initialize();
|
||||
settings = AppSettingsService();
|
||||
@@ -147,6 +151,7 @@ void main() {
|
||||
) async {
|
||||
final ctx = await host(tester);
|
||||
for (final animation in HolidayAnimation.values) {
|
||||
now = now.add(holidayAnimationMinInterval);
|
||||
playHolidayAnimation(ctx, animation, origin: const Offset(80, 500));
|
||||
await tester.pump();
|
||||
expect(find.byType(HolidayAnimationView), findsOneWidget);
|
||||
@@ -157,6 +162,42 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('one at a time, then 5 quiet seconds after it ends', (
|
||||
tester,
|
||||
) async {
|
||||
final ctx = await host(tester);
|
||||
void play(HolidayAnimation a) =>
|
||||
playHolidayAnimation(ctx, a, origin: Offset.zero);
|
||||
|
||||
play(HolidayAnimation.christmas);
|
||||
await tester.pump();
|
||||
expect(find.byType(HolidayAnimationView), findsOneWidget);
|
||||
|
||||
// Still playing: a second greeting is dropped, not stacked or queued.
|
||||
now = now.add(const Duration(seconds: 30));
|
||||
play(HolidayAnimation.newYear);
|
||||
await tester.pump();
|
||||
expect(find.byType(HolidayAnimationView), findsOneWidget);
|
||||
await tester.pumpAndSettle(); // christmas ends at `now`
|
||||
expect(find.byType(HolidayAnimationView), findsNothing);
|
||||
// Nothing was queued behind it.
|
||||
await tester.pump(const Duration(seconds: 10));
|
||||
expect(find.byType(HolidayAnimationView), findsNothing);
|
||||
|
||||
// Under 5 seconds after it ended: dropped.
|
||||
now = now.add(const Duration(seconds: 4));
|
||||
play(HolidayAnimation.newYear);
|
||||
await tester.pump();
|
||||
expect(find.byType(HolidayAnimationView), findsNothing);
|
||||
|
||||
// 5 seconds after it ended: plays.
|
||||
now = now.add(const Duration(seconds: 1));
|
||||
play(HolidayAnimation.newYear);
|
||||
await tester.pump();
|
||||
expect(find.byType(HolidayAnimationView), findsOneWidget);
|
||||
await tester.pumpAndSettle();
|
||||
});
|
||||
|
||||
testWidgets('respects the setting and reduced motion', (tester) async {
|
||||
await settings.setHolidayAnimationsEnabled(false);
|
||||
var ctx = await host(tester);
|
||||
|
||||
Reference in new issue
Block a user