refactor: Use self_fingerprint() where it makes sense (#8174)

This commit is contained in:
Hocuri
2026-04-26 09:36:08 +02:00
committed by GitHub
parent 0ad58f7a59
commit aa1f129a48
2 changed files with 3 additions and 7 deletions

View File

@@ -142,7 +142,7 @@ pub async fn get_securejoin_qr(context: &Context, chat: Option<ChatId>) -> Resul
let auth = create_id(); let auth = create_id();
token::save(context, Namespace::Auth, grpid, &auth, time()).await?; token::save(context, Namespace::Auth, grpid, &auth, time()).await?;
let fingerprint = get_self_fingerprint(context).await?.hex(); let fingerprint = self_fingerprint(context).await?;
let self_addr = context.get_primary_self_addr().await?; let self_addr = context.get_primary_self_addr().await?;
let self_addr_urlencoded = utf8_percent_encode(&self_addr, DISALLOWED_CHARACTERS).to_string(); let self_addr_urlencoded = utf8_percent_encode(&self_addr, DISALLOWED_CHARACTERS).to_string();

View File

@@ -6,7 +6,7 @@ use crate::chat::{self, Chat, add_contact_to_chat, remove_contact_from_chat, sen
use crate::config::Config; use crate::config::Config;
use crate::constants::Chattype; use crate::constants::Chattype;
use crate::contact::{Contact, ContactId}; use crate::contact::{Contact, ContactId};
use crate::key::{DcKey, load_self_public_key}; use crate::key::self_fingerprint;
use crate::message::{Message, Viewtype}; use crate::message::{Message, Viewtype};
use crate::mimefactory::MimeFactory; use crate::mimefactory::MimeFactory;
use crate::mimeparser::SystemMessage; use crate::mimeparser::SystemMessage;
@@ -152,11 +152,7 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> {
bob.sql bob.sql
.execute( .execute(
"DELETE FROM public_keys WHERE fingerprint=?", "DELETE FROM public_keys WHERE fingerprint=?",
(&load_self_public_key(alice) (&self_fingerprint(alice).await.unwrap(),),
.await
.unwrap()
.dc_fingerprint()
.hex(),),
) )
.await?; .await?;
let chat = Chat::load_from_db(bob, chat_id).await?; let chat = Chat::load_from_db(bob, chat_id).await?;