aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/account.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-07 20:50:29 +0000
committermat <git@matdoes.dev>2025-05-08 08:51:34 +1200
commite0d3352a90ddbdeb06314e6f38d2afe6fa4ddd78 (patch)
tree89e224255d7296f44b920a3fa872df1d87811ada /azalea-client/src/account.rs
parenta8e76a0bff182bbcb7b40e9283f78efbac7e630c (diff)
downloadazalea-drasl-e0d3352a90ddbdeb06314e6f38d2afe6fa4ddd78.tar.xz
add chat signing
Diffstat (limited to 'azalea-client/src/account.rs')
-rw-r--r--azalea-client/src/account.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs
index a4b35e81..9b2c2350 100644
--- a/azalea-client/src/account.rs
+++ b/azalea-client/src/account.rs
@@ -53,7 +53,7 @@ pub struct Account {
///
/// This is set when you call [`Self::request_certs`], but you only
/// need to if the servers you're joining require it.
- pub certs: Option<Certificates>,
+ pub certs: Arc<Mutex<Option<Certificates>>>,
}
/// The parameters that were passed for creating the associated [`Account`].
@@ -82,7 +82,7 @@ impl Account {
account_opts: AccountOpts::Offline {
username: username.to_string(),
},
- certs: None,
+ certs: Arc::new(Mutex::new(None)),
}
}
@@ -127,7 +127,7 @@ impl Account {
email: email.to_string(),
},
// we don't do chat signing by default unless the user asks for it
- certs: None,
+ certs: Arc::new(Mutex::new(None)),
})
}
@@ -194,7 +194,7 @@ impl Account {
account_opts: AccountOpts::MicrosoftWithAccessToken {
msa: Arc::new(Mutex::new(msa)),
},
- certs: None,
+ certs: Arc::new(Mutex::new(None)),
})
}
/// Refresh the access_token for this account to be valid again.
@@ -260,7 +260,7 @@ impl Account {
.lock()
.clone();
let certs = azalea_auth::certs::fetch_certificates(&access_token).await?;
- self.certs = Some(certs);
+ *self.certs.lock() = Some(certs);
Ok(())
}