implemented dual Nextcloud push registration with separate general and talk apptypes to ensure reliable Talk notification delivery; introduced stacked MessagingStyle notifications for chat threads with support for circular conversation avatars and disk caching

This commit is contained in:
2026-07-05 22:48:04 +02:00
parent 35e144799e
commit 483fea62ba
31 changed files with 2807 additions and 320 deletions
+11 -3
View File
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_app_badge/flutter_app_badge.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../push/chat_thread_store.dart';
import '../routing/app_routes.dart';
import '../state/app/modules/chat_list/bloc/chat_list_bloc.dart';
import 'notification_service.dart';
@@ -25,9 +26,9 @@ class NotificationTasks {
}
}
/// Per-chat tag scheme. MUST match the Notify backend, which sets this
/// value on `AndroidNotification.setTag` AND `apns-collapse-id`.
static String chatTag(String chatToken) => 'talk_$chatToken';
/// Per-chat tag scheme — canonical definition lives beside the stacked
/// notification id in chat_thread_store.dart.
static String chatTag(String chatToken) => chatNotificationTag(chatToken);
/// Removes tray notifications belonging to [chatToken]. Eraser handles
/// iOS (where the plugin's `getActiveNotifications` returns null ids
@@ -54,6 +55,13 @@ class NotificationTasks {
} on Object catch (e) {
log('Active-notification sweep failed: $e');
}
// Drop the stacked-notification history too — otherwise the next push
// would resurrect all already-read messages in the new notification.
try {
await ChatThreadStore().clearChat(chatToken);
} on Object catch (e) {
log('Chat thread cleanup failed: $e');
}
}
/// Refreshes the chat list. Deliberately does NOT touch [ChatBloc] —