chore: Remove Notification actions when using UnifiedPush

This commit is contained in:
Christian Kußowski 2025-11-14 09:27:00 +01:00
parent 8d7f376112
commit 31b3758622
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
2 changed files with 7 additions and 1 deletions

View file

@ -448,6 +448,7 @@ class BackgroundPush {
}
Future<void> _onUpMessage(PushMessage pushMessage, String i) async {
Logs().wtf('Push Notification from UP received', pushMessage);
final message = pushMessage.content;
upAction = true;
final data = Map<String, dynamic>.from(
@ -461,6 +462,8 @@ class BackgroundPush {
l10n: l10n,
activeRoomId: matrix?.activeRoomId,
flutterLocalNotificationsPlugin: _flutterLocalNotificationsPlugin,
useNotificationActions:
false, // Buggy with UP: https://codeberg.org/UnifiedPush/flutter-connector/issues/34
);
}
}

View file

@ -26,6 +26,7 @@ Future<void> pushHelper(
L10n? l10n,
String? activeRoomId,
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
bool useNotificationActions = true,
}) async {
try {
await _tryPushHelper(
@ -34,6 +35,7 @@ Future<void> pushHelper(
l10n: l10n,
activeRoomId: activeRoomId,
flutterLocalNotificationsPlugin: flutterLocalNotificationsPlugin,
useNotificationActions: useNotificationActions,
);
} catch (e, s) {
Logs().e('Push Helper has crashed! Writing into temporary file', e, s);
@ -69,6 +71,7 @@ Future<void> _tryPushHelper(
L10n? l10n,
String? activeRoomId,
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
bool useNotificationActions = true,
}) async {
final isBackgroundMessage = client == null;
Logs().v(
@ -278,7 +281,7 @@ Future<void> _tryPushHelper(
importance: Importance.high,
priority: Priority.max,
groupKey: event.room.spaceParents.firstOrNull?.roomId ?? 'rooms',
actions: event.type == EventTypes.RoomMember
actions: event.type == EventTypes.RoomMember || !useNotificationActions
? null
: <AndroidNotificationAction>[
AndroidNotificationAction(