From cf441e533d482c0a2edfedbc28c92e53204c41e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20Pikora?= Date: Tue, 3 Aug 2021 12:26:17 +0000 Subject: [PATCH] refactor: rename LoginState.logged to loggedIn --- example/main.dart | 2 +- lib/src/client.dart | 8 ++++---- test/client_test.dart | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/main.dart b/example/main.dart index 120cabca..65d79902 100644 --- a/example/main.dart +++ b/example/main.dart @@ -21,7 +21,7 @@ class FamedlySdkExampleApp extends StatelessWidget { if (snapshot.hasError) { return Center(child: Text(snapshot.error.toString())); } - if (snapshot.data == LoginState.logged) { + if (snapshot.data == LoginState.loggedIn) { return ChatListView(); } return LoginView(); diff --git a/lib/src/client.dart b/lib/src/client.dart index 066242ef..4f5b5245 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -43,7 +43,7 @@ import 'utils/multilock.dart'; typedef RoomSorter = int Function(Room a, Room b); -enum LoginState { logged, loggedOut } +enum LoginState { loggedIn, loggedOut } extension TrailingSlash on Uri { Uri stripTrailingSlash() => path.endsWith('/') @@ -838,10 +838,10 @@ class Client extends MatrixApi { /// Before you can connect you need at least an [accessToken], a [homeserver], /// a [userID], a [deviceID], and a [deviceName]. /// - /// Usually you don't need to call this method by yourself because [login()], [register()] + /// Usually you don't need to call this method yourself because [login()], [register()] /// and even the constructor calls it. /// - /// Sends [LoginState.logged] to [onLoginStateChanged]. + /// Sends [LoginState.loggedIn] to [onLoginStateChanged]. /// /// If one of [newToken], [newUserID], [newDeviceID], [newDeviceName] is set then /// all of them must be set! If you don't set them, this method will try to @@ -967,7 +967,7 @@ class Client extends MatrixApi { presences.clear(); } _initLock = false; - _loginState = LoginState.logged; + _loginState = LoginState.loggedIn; Logs().i( 'Successfully connected as ${userID.localpart} with ${homeserver.toString()}', ); diff --git a/test/client_test.dart b/test/client_test.dart index 6ef1c308..ff129ddc 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -113,7 +113,7 @@ void main() { final firstSync = await firstSyncFuture; final sync = await syncFuture; - expect(loginState, LoginState.logged); + expect(loginState, LoginState.loggedIn); expect(firstSync, true); expect(matrix.encryptionEnabled, olmEnabled); if (olmEnabled) {