mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 03:05:14 +00:00
Update .gitlab-ci.yml
Deleted assets/js/package/olm.js
This commit is contained in:
parent
95ad2a4b06
commit
52c3766321
7 changed files with 35 additions and 32 deletions
|
@ -27,9 +27,10 @@ build_web:
|
|||
- sudo apt update
|
||||
- sudo apt install curl -y
|
||||
- rm -r assets/js/package
|
||||
- cd assets/js/ && curl -O 'https://janian.de/index.php/s/ZKpQi4xFkGWPMHQ/download' && cd ../../
|
||||
- cd assets/js/ && mv download olm.tar.gz && cd ../../
|
||||
- cd assets/js/ && tar xaf olm.tar.gz && cd ../../
|
||||
- cd assets/js/ && curl -L 'https://gitlab.com/famedly/libraries/olm/-/jobs/artifacts/master/download?job=build_js' > olm.zip && cd ../../
|
||||
- cd assets/js/ && unzip olm.zip && cd ../../
|
||||
- cd assets/js/ && rm olm.zip && cd ../../
|
||||
- cd assets/js/ && mv javascript package && cd ../../
|
||||
- flutter pub get
|
||||
- flutter clean
|
||||
- flutter build web --release --verbose --dart-define=FLUTTER_WEB_USE_SKIA=true
|
||||
|
|
|
@ -1 +1 @@
|
|||
// Dummy file
|
||||
// Dummy file :-)
|
||||
|
|
|
@ -74,7 +74,7 @@ class MatrixState extends State<Matrix> {
|
|||
|
||||
void _initWithStore() async {
|
||||
var initLoginState = client.onLoginStateChanged.stream.first;
|
||||
client.database = await getDatabase(client, store);
|
||||
client.database = await getDatabase(client);
|
||||
client.connect();
|
||||
if (await initLoginState == LoginState.logged && !kIsWeb) {
|
||||
await FirebaseController.setupFirebase(
|
||||
|
|
|
@ -11,25 +11,29 @@ import './database/shared.dart';
|
|||
import 'package:olm/olm.dart' as olm; // needed for migration
|
||||
import 'package:random_string/random_string.dart';
|
||||
|
||||
Future<Database> getDatabase(Client client, Store store) async {
|
||||
Future<Database> getDatabase(Client client) async {
|
||||
if (_db != null) return _db;
|
||||
final store = Store();
|
||||
var password = await store.getItem('database-password');
|
||||
var needMigration = false;
|
||||
if (password == null || password.isEmpty) {
|
||||
needMigration = true;
|
||||
password = randomString(255);
|
||||
}
|
||||
final db = constructDb(
|
||||
_db = constructDb(
|
||||
logStatements: false,
|
||||
filename: 'moor.sqlite',
|
||||
password: password,
|
||||
);
|
||||
if (needMigration) {
|
||||
await migrate(client.clientName, db, store);
|
||||
await migrate(client.clientName, _db, store);
|
||||
await store.setItem('database-password', password);
|
||||
}
|
||||
return db;
|
||||
return _db;
|
||||
}
|
||||
|
||||
Database _db;
|
||||
|
||||
Future<void> migrate(String clientName, Database db, Store store) async {
|
||||
debugPrint('[Store] attempting old migration to moor...');
|
||||
final oldKeys = await store.getAllItems();
|
||||
|
@ -147,7 +151,13 @@ Future<void> migrate(String clientName, Database db, Store store) async {
|
|||
devices = List<String>.from(json.decode(devicesString));
|
||||
}
|
||||
await db.storeOutboundGroupSession(
|
||||
clientId, roomId, pickle, json.encode(devices));
|
||||
clientId,
|
||||
roomId,
|
||||
pickle,
|
||||
json.encode(devices),
|
||||
DateTime.now(),
|
||||
0,
|
||||
);
|
||||
}
|
||||
// session_keys
|
||||
final sessionKeysMatch =
|
||||
|
|
|
@ -151,8 +151,7 @@ abstract class FirebaseController {
|
|||
final platform = kIsWeb ? 'Web' : Platform.operatingSystem;
|
||||
final clientName = 'FluffyChat $platform';
|
||||
client = Client(clientName, debug: false);
|
||||
final store = Store();
|
||||
client.database = await getDatabase(client, store);
|
||||
client.database = await getDatabase(client);
|
||||
client.connect();
|
||||
await client.onLoginStateChanged.stream
|
||||
.firstWhere((l) => l == LoginState.logged)
|
||||
|
|
31
pubspec.lock
31
pubspec.lock
|
@ -71,13 +71,6 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -136,19 +129,12 @@ packages:
|
|||
url: "https://github.com/simolus3/moor.git"
|
||||
source: git
|
||||
version: "1.0.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
famedlysdk:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: bb690a22daab54a53a8df8e2dffb87da8a374bb1
|
||||
resolved-ref: bb690a22daab54a53a8df8e2dffb87da8a374bb1
|
||||
ref: "359e03496ad72f125ae275788621ac4f42d99d01"
|
||||
resolved-ref: "359e03496ad72f125ae275788621ac4f42d99d01"
|
||||
url: "https://gitlab.com/famedly/famedlysdk.git"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
|
@ -466,10 +452,10 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: "1.x.y"
|
||||
resolved-ref: "79868b06b3ea156f90b73abafb3bbf3ac4114cc6"
|
||||
resolved-ref: f66975bd1b5cb1865eba5efe6e3a392aa5e396a5
|
||||
url: "https://gitlab.com/famedly/libraries/dart-olm.git"
|
||||
source: git
|
||||
version: "1.0.0"
|
||||
version: "1.1.1"
|
||||
open_file:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -497,7 +483,7 @@ packages:
|
|||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.6.4"
|
||||
path_drawing:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -575,6 +561,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.2"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: quiver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
random_string:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -27,7 +27,7 @@ dependencies:
|
|||
famedlysdk:
|
||||
git:
|
||||
url: https://gitlab.com/famedly/famedlysdk.git
|
||||
ref: bb690a22daab54a53a8df8e2dffb87da8a374bb1
|
||||
ref: 359e03496ad72f125ae275788621ac4f42d99d01
|
||||
|
||||
localstorage: ^3.0.1+4
|
||||
bubble: ^1.1.9+1
|
||||
|
|
Loading…
Reference in a new issue