mirror of
https://github.com/chatmail/core.git
synced 2026-05-12 11:26:29 +03:00
refactor: do not store deprecated addr and is_default into keypairs
This commit is contained in:
12
src/key.rs
12
src/key.rs
@@ -337,17 +337,11 @@ pub(crate) async fn store_self_keypair(
|
|||||||
KeyPairUse::ReadOnly => false,
|
KeyPairUse::ReadOnly => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// `addr` and `is_default` written for compatibility with older versions,
|
|
||||||
// until new cores are rolled out everywhere.
|
|
||||||
// otherwise "add second device" or "backup" may break.
|
|
||||||
// moreover, this allows downgrades to the previous version.
|
|
||||||
// writing of `addr` and `is_default` can be removed ~ 2024-08
|
|
||||||
let addr = keypair.addr.to_string();
|
|
||||||
transaction
|
transaction
|
||||||
.execute(
|
.execute(
|
||||||
"INSERT OR REPLACE INTO keypairs (public_key, private_key, addr, is_default)
|
"INSERT OR REPLACE INTO keypairs (public_key, private_key)
|
||||||
VALUES (?,?,?,?)",
|
VALUES (?,?)",
|
||||||
(&public_key, &secret_key, addr, is_default),
|
(&public_key, &secret_key),
|
||||||
)
|
)
|
||||||
.context("Failed to insert keypair")?;
|
.context("Failed to insert keypair")?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user