mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-04 18:29:27 +01:00
Merge branch 'master' into soru/emoji-verification
This commit is contained in:
commit
a28e731bc3
@ -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 :-)
|
||||
|
@ -76,7 +76,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)
|
||||
|
@ -133,8 +133,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: "2b8f4b0d19df91caf002052ce793bd1a28630cc3"
|
||||
resolved-ref: "2b8f4b0d19df91caf002052ce793bd1a28630cc3"
|
||||
ref: "359e03496ad72f125ae275788621ac4f42d99d01"
|
||||
resolved-ref: "359e03496ad72f125ae275788621ac4f42d99d01"
|
||||
url: "https://gitlab.com/famedly/famedlysdk.git"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
@ -581,7 +581,7 @@ packages:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.4"
|
||||
version: "1.4.2"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -27,7 +27,7 @@ dependencies:
|
||||
famedlysdk:
|
||||
git:
|
||||
url: https://gitlab.com/famedly/famedlysdk.git
|
||||
ref: 2b8f4b0d19df91caf002052ce793bd1a28630cc3
|
||||
ref: 359e03496ad72f125ae275788621ac4f42d99d01
|
||||
|
||||
localstorage: ^3.0.1+4
|
||||
bubble: ^1.1.9+1
|
||||
|
Loading…
Reference in New Issue
Block a user