aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/chat_signing.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2026-01-01 22:28:53 -0600
committerGitHub <noreply@github.com>2026-01-01 22:28:53 -0600
commit1ca1f1d9e27aeea3adaf359570f2e211e0a9af74 (patch)
treedd35bb9bff67f0622a6410c99b5bd1678c9c8299 /azalea-client/src/plugins/chat_signing.rs
parent7b84235a9be5bdc7c05873467ad8310b57448d79 (diff)
downloadazalea-drasl-1ca1f1d9e27aeea3adaf359570f2e211e0a9af74.tar.xz
Extensible Account (#301)
* refactor Account * clean up implementation and docs * add AccountTrait::join * update changelog * update example
Diffstat (limited to 'azalea-client/src/plugins/chat_signing.rs')
-rw-r--r--azalea-client/src/plugins/chat_signing.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/azalea-client/src/plugins/chat_signing.rs b/azalea-client/src/plugins/chat_signing.rs
index 8e612f5b..2de9c6b0 100644
--- a/azalea-client/src/plugins/chat_signing.rs
+++ b/azalea-client/src/plugins/chat_signing.rs
@@ -13,7 +13,7 @@ use tracing::{debug, error};
use uuid::Uuid;
use super::{chat, login::IsAuthenticated, packet::game::SendGamePacketEvent};
-use crate::{Account, InGameState};
+use crate::{InGameState, account::Account};
pub struct ChatSigningPlugin;
impl Plugin for ChatSigningPlugin {
@@ -70,7 +70,7 @@ pub fn poll_request_certs_task(
commands.entity(entity).insert(QueuedCertsToSend {
certs: certs.clone(),
});
- *account.certs.lock() = Some(certs);
+ account.set_certs(certs);
}
Err(err) => {
error!("Error requesting certs: {err:?}. Retrying in an hour.");
@@ -108,8 +108,8 @@ pub fn request_certs_if_needed(
continue;
}
- let certs = account.certs.lock();
- let should_refresh = if let Some(certs) = &*certs {
+ let certs = account.certs();
+ let should_refresh = if let Some(certs) = certs {
// certs were already requested and we're waiting for them to refresh
// but maybe they weren't sent yet, in which case we still want to send the
@@ -122,12 +122,10 @@ pub fn request_certs_if_needed(
} else {
true
};
- drop(certs);
- if should_refresh && let Some(access_token) = &account.access_token {
+ if should_refresh && let Some(access_token) = account.access_token() {
let task_pool = IoTaskPool::get();
- let access_token = access_token.lock().clone();
debug!("Started task to fetch certs");
let task = task_pool.spawn(async_compat::Compat::new(async move {
azalea_auth::certs::fetch_certificates(&access_token).await