2021-04-12 18:33:43 +02:00
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
2021-05-22 09:24:39 +02:00
|
|
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/fluffy_client.dart';
|
2021-04-12 18:33:43 +02:00
|
|
|
|
|
|
|
Future<FluffyClient> testClient({
|
|
|
|
bool loggedIn = false,
|
|
|
|
String homeserver = 'https://fakeserver.notexisting',
|
|
|
|
String id = 'FluffyChat Widget Test',
|
|
|
|
}) async {
|
|
|
|
final client = FluffyClient(testMode: true);
|
|
|
|
if (homeserver != null) {
|
|
|
|
await client.checkHomeserver(homeserver);
|
|
|
|
}
|
|
|
|
if (loggedIn) {
|
|
|
|
await client.login(
|
|
|
|
identifier: AuthenticationUserIdentifier(user: '@alice:example.invalid'),
|
|
|
|
password: '1234',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return client;
|
|
|
|
}
|