chore: remove the userId param

now I do not pass userId in
This commit is contained in:
ShootingStarDragons 2025-11-19 19:39:36 +09:00
parent 175d06515d
commit 1c614490f1
2 changed files with 7 additions and 12 deletions

View file

@ -23,7 +23,7 @@ extension LocalNotificationsExtension on MatrixState {
..src = 'assets/assets/sounds/notification.ogg'
..load();
void showLocalNotification(Event event, String? userId) async {
void showLocalNotification(Event event) async {
final roomId = event.room.id;
if (activeRoomId == roomId) {
if (kIsWeb && webHasFocus) return;
@ -147,9 +147,7 @@ extension LocalNotificationsExtension on MatrixState {
);
break;
case DesktopNotificationActions.openChat:
if (userId != null) {
setActiveClient(event.room.client);
}
setActiveClient(event.room.client);
FluffyChatApp.router.go('/rooms/${event.room.id}');
break;

View file

@ -168,10 +168,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
_loginClientCandidate!.clientName,
store,
);
_registerSubs(
_loginClientCandidate!.clientName,
_loginClientCandidate!.userID,
);
_registerSubs(_loginClientCandidate!.clientName);
_loginClientCandidate = null;
FluffyChatApp.router.go('/rooms');
});
@ -224,7 +221,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
initMatrix();
}
void _registerSubs(String name, String? userId) {
void _registerSubs(String name) {
final c = getClientByName(name);
if (c == null) {
Logs().w(
@ -293,8 +290,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
if (PlatformInfos.isWeb || PlatformInfos.isLinux) {
c.onSync.stream.first.then((s) {
html.Notification.requestPermission();
onNotification[name] ??= c.onNotification.stream
.listen((data) => showLocalNotification(data, userId));
onNotification[name] ??=
c.onNotification.stream.listen(showLocalNotification);
});
}
}
@ -312,7 +309,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
void initMatrix() {
for (final c in widget.clients) {
_registerSubs(c.clientName, c.userID);
_registerSubs(c.clientName);
}
if (kIsWeb) {