matrix_sdk 0.0.7 matrix_sdk: ^0.0.7 copied to clipboard
A Dart implementation of the federated communications protocol, Matrix.
// Copyright (C) 2019 Wilko Manger
//
// This file is part of matrix-dart-sdk.
//
// matrix-dart-sdk is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// matrix-dart-sdk is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with matrix-dart-sdk. If not, see <https://www.gnu.org/licenses/>.
import 'package:matrix_sdk/matrix_sdk.dart';
void main() async {
final store = SembastStore(path: '/tmp/matrix.db');
// Open the store before passing it to the homeserver
await store.open();
final hs = Homeserver(Uri.parse("https://matrix.org"), store: store);
final user = await hs.login(Username("joe"), "badPassword");
await for (bool succes in user.sync()) {
if (succes) {
// Do something
}
}
}