chore: do as suggested
This commit is contained in:
parent
acce4a8d7b
commit
27b2eac7ed
3 changed files with 2 additions and 30 deletions
|
|
@ -415,7 +415,6 @@ class ChatListController extends State<ChatList>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Matrix.of(context).setController(this);
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -816,14 +815,6 @@ class ChatListController extends State<ChatList>
|
||||||
_clientStream.add(client);
|
_clientStream.add(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setActiveClientWithUserId(String name) {
|
|
||||||
setState(() {
|
|
||||||
activeFilter = ActiveFilter.allChats;
|
|
||||||
_activeSpaceId = null;
|
|
||||||
Matrix.of(context).setActiveClientWithUserId(name);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void setActiveBundle(String bundle) {
|
void setActiveBundle(String bundle) {
|
||||||
context.go('/rooms');
|
context.go('/rooms');
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
||||||
|
|
@ -147,8 +147,8 @@ extension LocalNotificationsExtension on MatrixState {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case DesktopNotificationActions.openChat:
|
case DesktopNotificationActions.openChat:
|
||||||
if (userId != null && controller != null) {
|
if (userId != null) {
|
||||||
controller!.setActiveClientWithUserId(userId);
|
setActiveClient(event.room.client);
|
||||||
}
|
}
|
||||||
|
|
||||||
FluffyChatApp.router.go('/rooms/${event.room.id}');
|
FluffyChatApp.router.go('/rooms/${event.room.id}');
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import 'package:universal_html/html.dart' as html;
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
|
||||||
import 'package:fluffychat/utils/client_manager.dart';
|
import 'package:fluffychat/utils/client_manager.dart';
|
||||||
import 'package:fluffychat/utils/init_with_restore.dart';
|
import 'package:fluffychat/utils/init_with_restore.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
||||||
|
|
@ -71,7 +70,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
bool? loginRegistrationSupported;
|
bool? loginRegistrationSupported;
|
||||||
|
|
||||||
BackgroundPush? backgroundPush;
|
BackgroundPush? backgroundPush;
|
||||||
ChatListController? controller;
|
|
||||||
|
|
||||||
Client get client {
|
Client get client {
|
||||||
if (_activeClient < 0 || _activeClient >= widget.clients.length) {
|
if (_activeClient < 0 || _activeClient >= widget.clients.length) {
|
||||||
|
|
@ -89,23 +87,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
|
|
||||||
late String currentClientSecret;
|
late String currentClientSecret;
|
||||||
RequestTokenResponse? currentThreepidCreds;
|
RequestTokenResponse? currentThreepidCreds;
|
||||||
void setActiveClientWithUserId(String userId) {
|
|
||||||
final i = widget.clients.indexWhere((c) => c.userID == userId);
|
|
||||||
if (i != -1) {
|
|
||||||
if (_activeClient == i) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_activeClient = i;
|
|
||||||
// TODO: Multi-client VoiP support
|
|
||||||
createVoipPlugin();
|
|
||||||
} else {
|
|
||||||
Logs().w('Tried to set an unknown user $userId as active');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setController(ChatListController controller) {
|
|
||||||
this.controller = controller;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setActiveClient(Client? cl) {
|
void setActiveClient(Client? cl) {
|
||||||
final i = widget.clients.indexWhere((c) => c == cl);
|
final i = widget.clients.indexWhere((c) => c == cl);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue