mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
extract constants out
This commit is contained in:
parent
d7d1d8c45a
commit
d24be7ee55
@ -18,6 +18,8 @@ import anotherjson from "../../../lib/another-json/index.js";
|
|||||||
|
|
||||||
const ACCOUNT_SESSION_KEY = "olmAccount";
|
const ACCOUNT_SESSION_KEY = "olmAccount";
|
||||||
const DEVICE_KEY_FLAG_SESSION_KEY = "areDeviceKeysUploaded";
|
const DEVICE_KEY_FLAG_SESSION_KEY = "areDeviceKeysUploaded";
|
||||||
|
const OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2";
|
||||||
|
const MEGOLM_ALGORITHM = "m.megolm.v1.aes-sha2";
|
||||||
|
|
||||||
export class Account {
|
export class Account {
|
||||||
static async load({olm, pickleKey, hsApi, userId, deviceId, txn}) {
|
static async load({olm, pickleKey, hsApi, userId, deviceId, txn}) {
|
||||||
@ -84,10 +86,7 @@ export class Account {
|
|||||||
const obj = {
|
const obj = {
|
||||||
user_id: this._userId,
|
user_id: this._userId,
|
||||||
device_id: this._deviceId,
|
device_id: this._deviceId,
|
||||||
algorithms: [
|
algorithms: [OLM_ALGORITHM, MEGOLM_ALGORITHM],
|
||||||
"m.olm.v1.curve25519-aes-sha2",
|
|
||||||
"m.megolm.v1.aes-sha2"
|
|
||||||
],
|
|
||||||
keys: {}
|
keys: {}
|
||||||
};
|
};
|
||||||
for (const [algorithm, pubKey] of Object.entries(identityKeys)) {
|
for (const [algorithm, pubKey] of Object.entries(identityKeys)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user