mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
strike last hard-coded ref to configured_addr
This commit is contained in:
@@ -91,16 +91,17 @@ impl DcKey for SignedPublicKey {
|
|||||||
type KeyType = SignedPublicKey;
|
type KeyType = SignedPublicKey;
|
||||||
|
|
||||||
async fn load_self(context: &Context) -> Result<Self::KeyType> {
|
async fn load_self(context: &Context) -> Result<Self::KeyType> {
|
||||||
|
let addr = context.get_primary_self_addr().await?;
|
||||||
match context
|
match context
|
||||||
.sql
|
.sql
|
||||||
.query_row_optional(
|
.query_row_optional(
|
||||||
r#"
|
r#"
|
||||||
SELECT public_key
|
SELECT public_key
|
||||||
FROM keypairs
|
FROM keypairs
|
||||||
WHERE addr=(SELECT value FROM config WHERE keyname="configured_addr")
|
WHERE addr=?
|
||||||
AND is_default=1;
|
AND is_default=1;
|
||||||
"#,
|
"#,
|
||||||
paramsv![],
|
paramsv![addr],
|
||||||
|row| {
|
|row| {
|
||||||
let bytes: Vec<u8> = row.get(0)?;
|
let bytes: Vec<u8> = row.get(0)?;
|
||||||
Ok(bytes)
|
Ok(bytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user