logout method

  1. @override
Future<void> logout()
override

Sends a logout command to the homeserver and clears all local data, including all persistent data from the store.

Implementation

@override
Future<void> logout() async {
  try {
    // Upload keys to make sure all are cached on the next login.
    await encryption?.keyManager.uploadInboundGroupSessions();
    await super.logout();
  } catch (e, s) {
    Logs().e('Logout failed', e, s);
    rethrow;
  } finally {
    await clear();
  }
}