mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Do not serialize is_default
It is only stored for compatibility with old versions
This commit is contained in:
@@ -772,13 +772,11 @@ VALUES (:folder,
|
||||
INSERT INTO
|
||||
keypairs (id,
|
||||
addr,
|
||||
is_default,
|
||||
private_key,
|
||||
public_key,
|
||||
created)
|
||||
VALUES (:id,
|
||||
:addr,
|
||||
:is_default,
|
||||
:private_key,
|
||||
:public_key,
|
||||
:created)",
|
||||
@@ -796,9 +794,6 @@ VALUES (:id,
|
||||
self.expect_key("id").await?;
|
||||
let id = self.expect_u32().await?;
|
||||
|
||||
self.expect_key("is_default").await?;
|
||||
let is_default = self.expect_bool().await?;
|
||||
|
||||
self.expect_key("private_key").await?;
|
||||
let private_key = self.expect_blob().await?;
|
||||
|
||||
@@ -810,7 +805,6 @@ VALUES (:id,
|
||||
stmt.execute(named_params! {
|
||||
":id": id,
|
||||
":addr": addr,
|
||||
":is_default": is_default,
|
||||
":private_key": private_key,
|
||||
":public_key": public_key,
|
||||
":created": created,
|
||||
|
||||
@@ -469,15 +469,13 @@ impl<'a, W: AsyncWrite + Unpin> Encoder<'a, W> {
|
||||
async fn serialize_keypairs(&mut self) -> Result<()> {
|
||||
let mut stmt = self
|
||||
.tx
|
||||
.prepare("SELECT id,addr,is_default,private_key,public_key,created FROM keypairs")?;
|
||||
.prepare("SELECT id,addr,private_key,public_key,created FROM keypairs")?;
|
||||
let mut rows = stmt.query(())?;
|
||||
|
||||
self.w.write_all(b"l").await?;
|
||||
while let Some(row) = rows.next()? {
|
||||
let id: u32 = row.get("id")?;
|
||||
let addr: String = row.get("addr")?;
|
||||
let is_default: u32 = row.get("is_default")?;
|
||||
let is_default = is_default != 0;
|
||||
let private_key: Vec<u8> = row.get("private_key")?;
|
||||
let public_key: Vec<u8> = row.get("public_key")?;
|
||||
let created: i64 = row.get("created")?;
|
||||
@@ -493,9 +491,6 @@ impl<'a, W: AsyncWrite + Unpin> Encoder<'a, W> {
|
||||
write_str(&mut self.w, "id").await?;
|
||||
write_u32(&mut self.w, id).await?;
|
||||
|
||||
write_str(&mut self.w, "is_default").await?;
|
||||
write_bool(&mut self.w, is_default).await?;
|
||||
|
||||
write_str(&mut self.w, "private_key").await?;
|
||||
write_bytes(&mut self.w, &private_key).await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user