Upgrade matrix sdk 0.13 (#485)

Co-authored-by: Ken Rachynski <chief@troublemaker.dev>
This commit is contained in:
vaw
2025-08-22 21:16:01 +00:00
committed by GitHub
parent 67603d0623
commit ad10082c2f
7 changed files with 196 additions and 100 deletions

View File

@@ -323,7 +323,7 @@ pub struct Session {
impl From<Session> for MatrixSession {
fn from(session: Session) -> Self {
MatrixSession {
tokens: matrix_sdk::authentication::matrix::MatrixSessionTokens {
tokens: matrix_sdk::authentication::SessionTokens {
access_token: session.access_token,
refresh_token: session.refresh_token,
},

View File

@@ -12,6 +12,7 @@ use matrix_sdk::{
RoomId,
},
Client,
EncryptionState,
};
use unicode_segmentation::UnicodeSegmentation;
@@ -182,8 +183,8 @@ async fn global_or_room_mode(
Ok(true) => IsOneToOne::Yes,
_ => IsOneToOne::No,
};
let is_encrypted = match room.is_encrypted().await {
Ok(true) => IsEncrypted::Yes,
let is_encrypted = match room.latest_encryption_state().await {
Ok(EncryptionState::Encrypted) => IsEncrypted::Yes,
_ => IsEncrypted::No,
};
settings

View File

@@ -91,12 +91,14 @@ impl SpaceState {
SpaceAction::SetChild(child_id, order, suggested) => {
if !self
.room
.can_user_send_state(
.power_levels()
.await
.map_err(matrix_sdk::Error::from)
.map_err(IambError::from)?
.user_can_send_state(
&store.application.settings.profile.user_id,
StateEventType::SpaceChild,
)
.await
.map_err(IambError::from)?
{
return Err(IambError::InsufficientPermission.into());
}
@@ -117,12 +119,14 @@ impl SpaceState {
let space = self.list.get().ok_or(IambError::NoSelectedRoomOrSpaceItem)?;
if !self
.room
.can_user_send_state(
.power_levels()
.await
.map_err(matrix_sdk::Error::from)
.map_err(IambError::from)?
.user_can_send_state(
&store.application.settings.profile.user_id,
StateEventType::SpaceChild,
)
.await
.map_err(IambError::from)?
{
return Err(IambError::InsufficientPermission.into());
}

View File

@@ -708,7 +708,7 @@ async fn create_client_inner(
.build()
.unwrap();
let req_config = RequestConfig::new().timeout(req_timeout).retry_timeout(req_timeout);
let req_config = RequestConfig::new().timeout(req_timeout).max_retry_time(req_timeout);
// Set up the Matrix client for the selected profile.
let builder = Client::builder()
@@ -1106,7 +1106,7 @@ impl ClientWorker {
ev.content.displayname.as_deref().unwrap_or_else(|| user_id.as_str()),
);
let ambiguous = client
.store()
.state_store()
.get_users_with_display_name(room_id, &ambiguous_name)
.await
.map(|users| users.len() > 1)
@@ -1244,7 +1244,7 @@ impl ClientWorker {
let settings = self.settings.clone();
async move {
while !client.logged_in() {
while !client.is_active() {
tokio::time::sleep(Duration::from_millis(100)).await;
}