mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
Merge branch 'krille/open-chat-linux-notifications' into 'main'
feat: Open chat button from Linux notification See merge request famedly/fluffychat!709
This commit is contained in:
commit
8ad6b52902
@ -2707,7 +2707,7 @@
|
||||
"@storyPrivacyWarning": {},
|
||||
"iUnderstand": "I understand",
|
||||
"@iUnderstand": {},
|
||||
"dismiss": "Dismiss",
|
||||
"openChat": "Open Chat",
|
||||
"markAsRead": "Mark as read",
|
||||
"reportUser": "Report user"
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
||||
@ -75,8 +76,8 @@ extension LocalNotificationsExtension on MatrixState {
|
||||
appIcon: appIconFile?.path ?? '',
|
||||
actions: [
|
||||
NotificationAction(
|
||||
DesktopNotificationActions.dismiss.name,
|
||||
L10n.of(widget.context)!.dismiss,
|
||||
DesktopNotificationActions.openChat.name,
|
||||
L10n.of(widget.context)!.openChat,
|
||||
),
|
||||
NotificationAction(
|
||||
DesktopNotificationActions.seen.name,
|
||||
@ -94,7 +95,8 @@ extension LocalNotificationsExtension on MatrixState {
|
||||
case DesktopNotificationActions.seen:
|
||||
room.setReadMarker(event.eventId, mRead: event.eventId);
|
||||
break;
|
||||
case DesktopNotificationActions.dismiss:
|
||||
case DesktopNotificationActions.openChat:
|
||||
VRouter.of(navigatorContext).toSegments(['rooms', room.id]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
@ -103,4 +105,4 @@ extension LocalNotificationsExtension on MatrixState {
|
||||
}
|
||||
}
|
||||
|
||||
enum DesktopNotificationActions { seen, dismiss }
|
||||
enum DesktopNotificationActions { seen, openChat }
|
||||
|
Loading…
Reference in New Issue
Block a user