refactor: Remove presence status feature

This commit is contained in:
Christian Pauly 2022-07-13 08:41:02 +02:00
parent 7c6874ed65
commit e2c95fc2b6
2 changed files with 0 additions and 14 deletions

View File

@ -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';

View File

@ -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();