Merge branch 'client-fix-upload-keys-try-again' into 'master'

[Client] Try again to upload keys

See merge request famedly/famedlysdk!196
This commit is contained in:
Christian Pauly 2020-02-17 17:15:49 +00:00
commit bf23664ccd

View file

@ -299,9 +299,6 @@ class Client {
newDeviceID: response["device_id"], newDeviceID: response["device_id"],
newMatrixVersions: matrixVersions, newMatrixVersions: matrixVersions,
newLazyLoadMembers: lazyLoadMembers); newLazyLoadMembers: lazyLoadMembers);
if (await this._uploadKeys(uploadDeviceKeys: true) == false) {
await this.logout();
}
} }
return response; return response;
} }
@ -345,10 +342,6 @@ class Client {
newMatrixVersions: matrixVersions, newMatrixVersions: matrixVersions,
newLazyLoadMembers: lazyLoadMembers, newLazyLoadMembers: lazyLoadMembers,
); );
if (await this._uploadKeys(uploadDeviceKeys: true) == false) {
await this.logout();
return false;
}
return true; return true;
} }
return false; return false;
@ -691,6 +684,9 @@ class Client {
await olm.init(); await olm.init();
this._olmAccount = olm.Account(); this._olmAccount = olm.Account();
this._olmAccount.create(); this._olmAccount.create();
if (await this._uploadKeys(uploadDeviceKeys: true) == false) {
throw ("Upload key failed");
}
} catch (_) { } catch (_) {
this._olmAccount = null; this._olmAccount = null;
} }