mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 22:42:33 +01:00
refactor: Remove presence status feature
This commit is contained in:
parent
7c6874ed65
commit
e2c95fc2b6
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/chat_list/client_chooser_button.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
@ -223,7 +223,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
final onUiaRequest = <String, StreamSubscription<UiaRequest>>{};
|
||||
StreamSubscription<html.Event>? onFocusSub;
|
||||
StreamSubscription<html.Event>? onBlurSub;
|
||||
final onOwnPresence = <String, StreamSubscription<CachedPresence>>{};
|
||||
|
||||
String? _cachedPassword;
|
||||
Timer? _cachedPasswordClearTimer;
|
||||
@ -340,15 +339,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
);
|
||||
}
|
||||
});
|
||||
// Cache and resend status message
|
||||
onOwnPresence[name] ??= c.onPresenceChanged.stream.listen((presence) {
|
||||
if (c.isLogged() &&
|
||||
c.userID == presence.userid &&
|
||||
presence.statusMsg != null) {
|
||||
Logs().v('Update status message: "${presence.statusMsg}"');
|
||||
store.setItem(SettingKeys.ownStatusMessage, presence.statusMsg);
|
||||
}
|
||||
});
|
||||
onUiaRequest[name] ??= c.onUiaRequest.stream.listen(uiaRequestHandler);
|
||||
if (PlatformInfos.isWeb || PlatformInfos.isLinux) {
|
||||
c.onSync.stream.first.then((s) {
|
||||
@ -371,8 +361,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
onKeyVerificationRequestSub.remove(name);
|
||||
onLoginStateChanged[name]?.cancel();
|
||||
onLoginStateChanged.remove(name);
|
||||
onOwnPresence[name]?.cancel();
|
||||
onOwnPresence.remove(name);
|
||||
onNotification[name]?.cancel();
|
||||
onNotification.remove(name);
|
||||
}
|
||||
@ -516,7 +504,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
onRoomKeyRequestSub.values.map((s) => s.cancel());
|
||||
onKeyVerificationRequestSub.values.map((s) => s.cancel());
|
||||
onLoginStateChanged.values.map((s) => s.cancel());
|
||||
onOwnPresence.values.map((s) => s.cancel());
|
||||
onNotification.values.map((s) => s.cancel());
|
||||
client.httpClient.close();
|
||||
onFocusSub?.cancel();
|
||||
|
Loading…
Reference in New Issue
Block a user