[fractal/fractal-next] Update matrix-sdk



commit e6740768ca2d656c349bfc31c85efc9b4d4ff17d
Author: Julian Sparber <julian sparber net>
Date:   Thu Mar 10 15:41:47 2022 +0100

    Update matrix-sdk

 Cargo.lock                                         | 224 +++++++++++++++------
 src/components/auth_dialog.rs                      |   4 +-
 src/login.rs                                       |   2 +-
 .../account_settings/devices_page/device.rs        |   7 +-
 .../account_settings/devices_page/device_list.rs   |   2 +-
 .../user_page/change_password_subpage.rs           |   7 +-
 .../user_page/deactivate_account_subpage.rs        |   6 +-
 src/session/account_settings/user_page/mod.rs      |   4 +-
 src/session/avatar.rs                              |   2 +-
 src/session/content/explore/mod.rs                 |   6 +-
 src/session/content/explore/public_room_list.rs    |   2 +-
 src/session/content/explore/public_room_row.rs     |   3 -
 .../room_details/invite_subpage/invitee_list.rs    |   6 +-
 .../content/room_history/message_row/media.rs      |   2 +-
 src/session/content/room_history/mod.rs            |   4 +-
 src/session/mod.rs                                 |  26 +--
 src/session/room/mod.rs                            |  21 +-
 src/session/room_creation/mod.rs                   |   4 +-
 src/session/verification/verification_list.rs      |   2 +-
 19 files changed, 218 insertions(+), 116 deletions(-)
---
diff --git a/Cargo.lock b/Cargo.lock
index 46a81d203..b48d66970 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -692,12 +692,13 @@ dependencies = [
 
 [[package]]
 name = "dashmap"
-version = "4.0.2"
+version = "5.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
+checksum = "c0834a35a3fce649144119e18da2a4d8ed12ef3862f47183fd46f625d072d96c"
 dependencies = [
  "cfg-if 1.0.0",
  "num_cpus",
+ "parking_lot 0.12.0",
 ]
 
 [[package]]
@@ -1786,7 +1787,7 @@ checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03"
 dependencies = [
  "bytes",
  "fnv",
- "itoa 1.0.1",
+ "itoa",
 ]
 
 [[package]]
@@ -1833,7 +1834,7 @@ dependencies = [
  "http-body",
  "httparse",
  "httpdate",
- "itoa 1.0.1",
+ "itoa",
  "pin-project-lite",
  "socket2",
  "tokio",
@@ -1932,12 +1933,6 @@ dependencies = [
  "either",
 ]
 
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
 [[package]]
 name = "itoa"
 version = "1.0.1"
@@ -2212,7 +2207,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
 [[package]]
 name = "matrix-qrcode"
 version = "0.2.0"
-source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#70490277eb6e56d3d1c637b1967f3a01ed67e9d8";
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
 dependencies = [
  "base64",
  "byteorder",
@@ -2227,7 +2222,7 @@ dependencies = [
 [[package]]
 name = "matrix-sdk"
 version = "0.4.1"
-source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#70490277eb6e56d3d1c637b1967f3a01ed67e9d8";
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
 dependencies = [
  "anymap2",
  "async-stream",
@@ -2241,6 +2236,7 @@ dependencies = [
  "http",
  "matrix-sdk-base",
  "matrix-sdk-common",
+ "matrix-sdk-sled",
  "mime",
  "reqwest",
  "ruma",
@@ -2256,8 +2252,9 @@ dependencies = [
 [[package]]
 name = "matrix-sdk-base"
 version = "0.4.1"
-source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#70490277eb6e56d3d1c637b1967f3a01ed67e9d8";
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
 dependencies = [
+ "anyhow",
  "async-stream",
  "chacha20poly1305",
  "dashmap",
@@ -2274,9 +2271,7 @@ dependencies = [
  "serde",
  "serde_json",
  "sha2 0.10.2",
- "sled",
  "thiserror",
- "tokio",
  "tracing",
  "zeroize",
 ]
@@ -2284,7 +2279,7 @@ dependencies = [
 [[package]]
 name = "matrix-sdk-common"
 version = "0.4.1"
-source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#70490277eb6e56d3d1c637b1967f3a01ed67e9d8";
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
 dependencies = [
  "async-lock",
  "async-trait",
@@ -2294,18 +2289,17 @@ dependencies = [
  "serde",
  "tokio",
  "uuid",
- "wasm-bindgen",
  "wasm-bindgen-futures",
- "web-sys",
 ]
 
 [[package]]
 name = "matrix-sdk-crypto"
 version = "0.4.1"
-source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#70490277eb6e56d3d1c637b1967f3a01ed67e9d8";
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
 dependencies = [
  "aes",
  "aes-gcm",
+ "anyhow",
  "atomic",
  "base64",
  "bs58",
@@ -2323,12 +2317,32 @@ dependencies = [
  "serde",
  "serde_json",
  "sha2 0.10.2",
- "sled",
  "thiserror",
  "tracing",
  "zeroize",
 ]
 
+[[package]]
+name = "matrix-sdk-sled"
+version = "0.1.0"
+source = "git+https://github.com/matrix-org/matrix-rust-sdk.git#88f1552a70521ca969e2759f484ab46d76c33a5e";
+dependencies = [
+ "anyhow",
+ "async-stream",
+ "dashmap",
+ "futures-core",
+ "futures-util",
+ "matrix-sdk-base",
+ "matrix-sdk-common",
+ "matrix-sdk-crypto",
+ "serde",
+ "serde_json",
+ "sled",
+ "thiserror",
+ "tokio",
+ "tracing",
+]
+
 [[package]]
 name = "memchr"
 version = "2.4.1"
@@ -2734,7 +2748,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
 dependencies = [
  "instant",
  "lock_api",
- "parking_lot_core",
+ "parking_lot_core 0.8.5",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
+dependencies = [
+ "lock_api",
+ "parking_lot_core 0.9.1",
 ]
 
 [[package]]
@@ -2751,6 +2775,19 @@ dependencies = [
  "winapi",
 ]
 
+[[package]]
+name = "parking_lot_core"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-sys",
+]
+
 [[package]]
 name = "paste"
 version = "1.0.6"
@@ -3246,8 +3283,9 @@ dependencies = [
 
 [[package]]
 name = "ruma"
-version = "0.4.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "377d836ac9faf53c56aa8610c596be4d2e0881600b20d0c4a3a09694989f664f"
 dependencies = [
  "assign",
  "js_int",
@@ -3264,8 +3302,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-api"
-version = "0.18.5"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "2fc1c16c9b7d21791e4c2d082da3d050ea1cebe004af30275fb2e6f547e1a283"
 dependencies = [
  "bytes",
  "http",
@@ -3276,12 +3315,14 @@ dependencies = [
  "serde",
  "serde_json",
  "thiserror",
+ "tracing",
 ]
 
 [[package]]
 name = "ruma-api-macros"
-version = "0.18.5"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "6cc6143101ea576d8763468a3b8889c5d9062402204d172bde3b99912a16e5cc"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2 1.0.36",
@@ -3291,8 +3332,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-client-api"
-version = "0.12.3"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "9d360ec8cdb7e0815b8b6ab06345c68972aa2e7c564578cd05f3eb2845a785a9"
 dependencies = [
  "assign",
  "bytes",
@@ -3311,8 +3353,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-common"
-version = "0.6.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "98080b1aac4045f5988ae5e2ccfe1864487c151c1717d29fe1388b7e06383d3e"
 dependencies = [
  "indexmap",
  "js_int",
@@ -3326,8 +3369,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-events"
-version = "0.24.6"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "d2b661cc7dd619039c99aea1e42c06e3ac9a29a1d648dc3bcbb4f0dffcb49d04"
 dependencies = [
  "indoc",
  "js_int",
@@ -3344,8 +3388,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-events-macros"
-version = "0.24.6"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "6e9f4f3ac886d490d030bd3c5e50d21b80de5537bde04dd4529e27a0cc1e2201"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2 1.0.36",
@@ -3355,8 +3400,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-federation-api"
-version = "0.3.1"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "bf1c02bf70a1cde9cf7d014544f1f63dee122ba7026a3b5535a9fc4f3ab888cd"
 dependencies = [
  "js_int",
  "ruma-api",
@@ -3370,46 +3416,62 @@ dependencies = [
 
 [[package]]
 name = "ruma-identifiers"
-version = "0.20.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "e7bc99002443cfdf64d1158e8e6e280b3633e17d91049ad9516ad475358b3b8b"
 dependencies = [
  "percent-encoding",
  "rand 0.8.5",
  "ruma-identifiers-macros",
- "ruma-identifiers-validation",
+ "ruma-identifiers-validation 0.7.0",
  "ruma-serde",
  "ruma-serde-macros",
  "serde",
+ "url",
  "uuid",
 ]
 
 [[package]]
 name = "ruma-identifiers-macros"
-version = "0.20.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "503738488e3a378677e8b159478dbb07d2d70f1e1f3320c0bd3a51a99e44cf7c"
 dependencies = [
  "quote 1.0.15",
- "ruma-identifiers-validation",
+ "ruma-identifiers-validation 0.6.0",
  "syn 1.0.86",
 ]
 
 [[package]]
 name = "ruma-identifiers-validation"
-version = "0.5.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "c670c45c3c86eaf5ff9b4bfd66a2a57116f2d808c9f8cbfc957cd34c48032ff9"
 dependencies = [
  "thiserror",
+ "url",
+]
+
+[[package]]
+name = "ruma-identifiers-validation"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "5dc675917d537c870035d4681d7a2b939683fb908bbc036aa55889b09c5794f1"
+dependencies = [
+ "thiserror",
+ "url",
 ]
 
 [[package]]
 name = "ruma-serde"
-version = "0.5.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "0d44a6e4aabe679009ba0e26d37b43ea725591fcb3c82724bcfc0c3823d807cf"
 dependencies = [
  "base64",
  "bytes",
  "form_urlencoded",
- "itoa 0.4.8",
+ "itoa",
  "js_int",
  "ruma-serde-macros",
  "serde",
@@ -3418,8 +3480,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-serde-macros"
-version = "0.5.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "d38cd6f6edebc09b9e4b4ecb24279dae0b700ecfc3a2d5eff9f8b60c41f73c03"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2 1.0.36",
@@ -3429,8 +3492,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-signatures"
-version = "0.9.0"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "6f08deeb5241428e6f1db085bc0ae6aeb469d20f45164a7f5500901add47770d"
 dependencies = [
  "base64",
  "ed25519-dalek",
@@ -3446,8 +3510,9 @@ dependencies = [
 
 [[package]]
 name = "ruma-state-res"
-version = "0.4.1"
-source = 
"git+https://github.com/ruma/ruma/?rev=b9f32bc6327542d382d4eb42ec43623495c50e66#b9f32bc6327542d382d4eb42ec43623495c50e66";
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "8c3328d01db08c51a66ac4093dd42151376a20fffebc6763a886d3e6d59d1ebc"
 dependencies = [
  "itertools",
  "js_int",
@@ -3577,7 +3642,7 @@ version = "1.0.79"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
 dependencies = [
- "itoa 1.0.1",
+ "itoa",
  "ryu",
  "serde",
 ]
@@ -3600,7 +3665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
 dependencies = [
  "form_urlencoded",
- "itoa 1.0.1",
+ "itoa",
  "ryu",
  "serde",
 ]
@@ -3700,7 +3765,7 @@ dependencies = [
  "fxhash",
  "libc",
  "log",
- "parking_lot",
+ "parking_lot 0.11.2",
 ]
 
 [[package]]
@@ -3778,7 +3843,7 @@ checksum = "33994d0838dc2d152d17a62adf608a869b5e846b65b389af7f3dbc1de45c5b26"
 dependencies = [
  "lazy_static",
  "new_debug_unreachable",
- "parking_lot",
+ "parking_lot 0.11.2",
  "phf_shared 0.10.0",
  "precomputed-hash",
  "serde",
@@ -4455,6 +4520,49 @@ version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
 
+[[package]]
+name = "windows-sys"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6"
+dependencies = [
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.32.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
+
 [[package]]
 name = "winreg"
 version = "0.7.0"
diff --git a/src/components/auth_dialog.rs b/src/components/auth_dialog.rs
index 763ac2ad0..fdb50b698 100644
--- a/src/components/auth_dialog.rs
+++ b/src/components/auth_dialog.rs
@@ -14,7 +14,7 @@ use matrix_sdk::{
         api::{
             client::{
                 error::ErrorBody,
-                r0::uiaa::{
+                uiaa::{
                     AuthData as MatrixAuthData, AuthType,
                     FallbackAcknowledgement as MatrixFallbackAcknowledgement,
                     Password as MatrixPassword, UiaaInfo, UiaaResponse, UserIdentifier,
@@ -59,7 +59,7 @@ impl AuthData {
                 password,
                 session,
             }) => MatrixAuthData::Password(assign!(MatrixPassword::new(
-                                UserIdentifier::MatrixId(user_id),
+                                UserIdentifier::UserIdOrLocalpart(user_id),
                                 password,
                             ), { session: session.as_deref() })),
             AuthData::FallbackAcknowledgement(FallbackAcknowledgement { session }) => {
diff --git a/src/login.rs b/src/login.rs
index 85d994e8c..9498be5dd 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -5,7 +5,7 @@ use log::{debug, warn};
 use matrix_sdk::{
     config::RequestConfig,
     ruma::{
-        api::client::unversioned::get_supported_versions, identifiers::Error as IdentifierError,
+        api::client::discover::get_supported_versions, identifiers::Error as IdentifierError,
         ServerName, UserId,
     },
     Client, Result as MatrixResult,
diff --git a/src/session/account_settings/devices_page/device.rs 
b/src/session/account_settings/devices_page/device.rs
index 1a6a30c55..4b17d2f12 100644
--- a/src/session/account_settings/devices_page/device.rs
+++ b/src/session/account_settings/devices_page/device.rs
@@ -2,7 +2,7 @@ use gtk::{glib, prelude::*, subclass::prelude::*};
 use matrix_sdk::{
     encryption::identities::Device as CryptoDevice,
     ruma::{
-        api::client::r0::device::{delete_device, Device as MatrixDevice},
+        api::client::device::{delete_device, Device as MatrixDevice},
         assign,
         identifiers::DeviceId,
     },
@@ -191,10 +191,11 @@ impl Device {
                 async move {
                     if let Some(auth) = auth_data {
                         let auth = Some(auth.as_matrix_auth_data());
-                        let request = assign!(delete_device::Request::new(&device_id), { auth });
+                        let request =
+                            assign!(delete_device::v3::Request::new(&device_id), { auth });
                         client.send(request, None).await.map_err(Into::into)
                     } else {
-                        let request = delete_device::Request::new(&device_id);
+                        let request = delete_device::v3::Request::new(&device_id);
                         client.send(request, None).await.map_err(Into::into)
                     }
                 }
diff --git a/src/session/account_settings/devices_page/device_list.rs 
b/src/session/account_settings/devices_page/device_list.rs
index 644d60dca..f95dd1b3f 100644
--- a/src/session/account_settings/devices_page/device_list.rs
+++ b/src/session/account_settings/devices_page/device_list.rs
@@ -3,7 +3,7 @@ use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*};
 use log::error;
 use matrix_sdk::{
     encryption::identities::UserDevices as CryptoDevices,
-    ruma::api::client::r0::device::Device as MatrixDevice, Error,
+    ruma::api::client::device::Device as MatrixDevice, Error,
 };
 
 use super::{Device, DeviceItem};
diff --git a/src/session/account_settings/user_page/change_password_subpage.rs 
b/src/session/account_settings/user_page/change_password_subpage.rs
index 026426cc3..b80710828 100644
--- a/src/session/account_settings/user_page/change_password_subpage.rs
+++ b/src/session/account_settings/user_page/change_password_subpage.rs
@@ -9,7 +9,7 @@ use log::error;
 use matrix_sdk::{
     ruma::{
         api::{
-            client::r0::account::change_password,
+            client::account::change_password,
             error::{FromHttpResponseError, ServerError},
         },
         assign,
@@ -295,10 +295,11 @@ impl ChangePasswordSubpage {
                 async move {
                     if let Some(auth) = auth_data {
                         let auth = Some(auth.as_matrix_auth_data());
-                        let request = assign!(change_password::Request::new(&password), { auth });
+                        let request =
+                            assign!(change_password::v3::Request::new(&password), { auth });
                         client.send(request, None).await.map_err(Into::into)
                     } else {
-                        let request = change_password::Request::new(&password);
+                        let request = change_password::v3::Request::new(&password);
                         client.send(request, None).await.map_err(Into::into)
                     }
                 }
diff --git a/src/session/account_settings/user_page/deactivate_account_subpage.rs 
b/src/session/account_settings/user_page/deactivate_account_subpage.rs
index 4294468a2..19533296a 100644
--- a/src/session/account_settings/user_page/deactivate_account_subpage.rs
+++ b/src/session/account_settings/user_page/deactivate_account_subpage.rs
@@ -6,7 +6,7 @@ use gtk::{
     CompositeTemplate,
 };
 use log::error;
-use matrix_sdk::ruma::{api::client::r0::account::deactivate, assign};
+use matrix_sdk::ruma::{api::client::account::deactivate, assign};
 
 use crate::{
     components::{AuthDialog, EntryRow, SpinnerButton, Toast},
@@ -182,10 +182,10 @@ impl DeactivateAccountSubpage {
             .authenticate(move |client, auth_data| async move {
                 if let Some(auth) = auth_data {
                     let auth = Some(auth.as_matrix_auth_data());
-                    let request = assign!(deactivate::Request::new(), { auth });
+                    let request = assign!(deactivate::v3::Request::new(), { auth });
                     client.send(request, None).await.map_err(Into::into)
                 } else {
-                    let request = deactivate::Request::new();
+                    let request = deactivate::v3::Request::new();
                     client.send(request, None).await.map_err(Into::into)
                 }
             })
diff --git a/src/session/account_settings/user_page/mod.rs b/src/session/account_settings/user_page/mod.rs
index 38be6f849..c1053e8a1 100644
--- a/src/session/account_settings/user_page/mod.rs
+++ b/src/session/account_settings/user_page/mod.rs
@@ -9,7 +9,7 @@ use gtk::{
     CompositeTemplate,
 };
 use log::error;
-use matrix_sdk::ruma::{api::client::r0::capabilities::get_capabilities, MxcUri};
+use matrix_sdk::ruma::{api::client::capabilities::get_capabilities, MxcUri};
 
 mod change_password_subpage;
 mod deactivate_account_subpage;
@@ -450,7 +450,7 @@ impl UserPage {
 
                 // Check whether the user can change their password.
                 let handle = spawn_tokio!(async move {
-                    client.send(get_capabilities::Request::new(), None).await
+                    client.send(get_capabilities::v3::Request::new(), None).await
                 });
                 match handle.await.unwrap() {
                     Ok(res) => {
diff --git a/src/session/avatar.rs b/src/session/avatar.rs
index c96cd1d29..3b5efb3f9 100644
--- a/src/session/avatar.rs
+++ b/src/session/avatar.rs
@@ -6,7 +6,7 @@ use matrix_sdk::{
     media::{MediaFormat, MediaRequest, MediaThumbnailSize, MediaType},
     room::Room as MatrixRoom,
     ruma::{
-        api::client::r0::media::get_content_thumbnail::Method,
+        api::client::media::get_content_thumbnail::v3::Method,
         events::{room::avatar::RoomAvatarEventContent, AnyStateEventContent},
         identifiers::MxcUri,
     },
diff --git a/src/session/content/explore/mod.rs b/src/session/content/explore/mod.rs
index eba2fdbce..e908ad7af 100644
--- a/src/session/content/explore/mod.rs
+++ b/src/session/content/explore/mod.rs
@@ -5,7 +5,7 @@ mod public_room_row;
 use adw::subclass::prelude::*;
 use gtk::{glib, glib::clone, prelude::*, subclass::prelude::*, CompositeTemplate};
 use log::error;
-use matrix_sdk::ruma::api::client::r0::thirdparty::get_protocols;
+use matrix_sdk::ruma::api::client::thirdparty::get_protocols;
 
 pub use self::{
     public_room::PublicRoom, public_room_list::PublicRoomList, public_room_row::PublicRoomRow,
@@ -209,7 +209,7 @@ impl Explore {
         }
     }
 
-    fn set_protocols(&self, protocols: get_protocols::Response) {
+    fn set_protocols(&self, protocols: get_protocols::v3::Response) {
         for protocol in protocols
             .protocols
             .into_iter()
@@ -231,7 +231,7 @@ impl Explore {
         network_menu.set_active(Some(0));
 
         let handle =
-            spawn_tokio!(async move { client.send(get_protocols::Request::new(), None).await });
+            spawn_tokio!(async move { client.send(get_protocols::v3::Request::new(), None).await });
 
         spawn!(
             glib::PRIORITY_DEFAULT_IDLE,
diff --git a/src/session/content/explore/public_room_list.rs b/src/session/content/explore/public_room_list.rs
index 5a487f8ea..4f9409e2f 100644
--- a/src/session/content/explore/public_room_list.rs
+++ b/src/session/content/explore/public_room_list.rs
@@ -3,7 +3,7 @@ use std::convert::TryFrom;
 use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*};
 use log::error;
 use matrix_sdk::ruma::{
-    api::client::r0::directory::get_public_rooms_filtered::{
+    api::client::directory::get_public_rooms_filtered::v3::{
         Request as PublicRoomsRequest, Response as PublicRoomsResponse,
     },
     assign,
diff --git a/src/session/content/explore/public_room_row.rs b/src/session/content/explore/public_room_row.rs
index fdd222c58..7a39c4edb 100644
--- a/src/session/content/explore/public_room_row.rs
+++ b/src/session/content/explore/public_room_row.rs
@@ -171,9 +171,6 @@ impl PublicRoomRow {
                 let has_alias = if let Some(ref alias) = matrix_public_room.canonical_alias {
                     priv_.alias.set_text(alias.as_str());
                     true
-                } else if let Some(alias) = matrix_public_room.aliases.get(0) {
-                    priv_.alias.set_text(alias.as_str());
-                    true
                 } else {
                     false
                 };
diff --git a/src/session/content/room_details/invite_subpage/invitee_list.rs 
b/src/session/content/room_details/invite_subpage/invitee_list.rs
index 4d0af43e4..04f4a5358 100644
--- a/src/session/content/room_details/invite_subpage/invitee_list.rs
+++ b/src/session/content/room_details/invite_subpage/invitee_list.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
 use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*};
 use log::error;
 use matrix_sdk::{
-    ruma::{api::client::r0::user_directory::search_users, identifiers::UserId},
+    ruma::{api::client::user_directory::search_users, identifiers::UserId},
     HttpError,
 };
 
@@ -227,7 +227,7 @@ impl InviteeList {
     fn finish_search(
         &self,
         search_term: String,
-        response: Result<search_users::Response, HttpError>,
+        response: Result<search_users::v3::Response, HttpError>,
     ) {
         let session = self.room().session();
         let member_list = self.room().members();
@@ -307,7 +307,7 @@ impl InviteeList {
 
         let search_term_clone = search_term.clone();
         let handle = spawn_tokio!(async move {
-            let request = search_users::Request::new(&search_term_clone);
+            let request = search_users::v3::Request::new(&search_term_clone);
             client.send(request, None).await
         });
 
diff --git a/src/session/content/room_history/message_row/media.rs 
b/src/session/content/room_history/message_row/media.rs
index 3a24a1f67..d2132ab09 100644
--- a/src/session/content/room_history/message_row/media.rs
+++ b/src/session/content/room_history/message_row/media.rs
@@ -10,7 +10,7 @@ use log::warn;
 use matrix_sdk::{
     media::{MediaEventContent, MediaThumbnailSize},
     ruma::{
-        api::client::r0::media::get_content_thumbnail::Method,
+        api::client::media::get_content_thumbnail::v3::Method,
         events::{
             room::message::{ImageMessageEventContent, VideoMessageEventContent},
             sticker::StickerEventContent,
diff --git a/src/session/content/room_history/mod.rs b/src/session/content/room_history/mod.rs
index 834dfc869..ef71a9c0d 100644
--- a/src/session/content/room_history/mod.rs
+++ b/src/session/content/room_history/mod.rs
@@ -408,7 +408,7 @@ impl RoomHistory {
                     .user()
                     .map(|user| {
                         (
-                            user.user_id().matrix_to_url().to_string(),
+                            user.user_id().matrix_to_uri().to_string(),
                             user.display_name(),
                         )
                     })
@@ -417,7 +417,7 @@ impl RoomHistory {
                             (
                                 // No server name needed. matrix.to URIs for mentions aren't
                                 // routable
-                                room.room_id().matrix_to_url([]).to_string(),
+                                room.room_id().matrix_to_uri([]).to_string(),
                                 room.display_name(),
                             )
                         })
diff --git a/src/session/mod.rs b/src/session/mod.rs
index dda550163..4f2768ae9 100644
--- a/src/session/mod.rs
+++ b/src/session/mod.rs
@@ -30,16 +30,15 @@ use matrix_sdk::{
         api::{
             client::{
                 error::ErrorKind,
-                r0::{
-                    filter::{FilterDefinition, LazyLoadOptions, RoomEventFilter, RoomFilter},
-                    session::logout,
-                },
+                filter::{FilterDefinition, LazyLoadOptions, RoomEventFilter, RoomFilter},
+                session::logout,
             },
             error::{FromHttpResponseError, ServerError},
         },
         assign,
         identifiers::RoomId,
     },
+    store::make_store_config,
     Client, HttpError,
 };
 use rand::{distributions::Alphanumeric, thread_rng, Rng};
@@ -304,13 +303,13 @@ impl Session {
                     .map(char::from)
                     .collect()
             };
-            let config = ClientConfig::new()
+            let store_config = make_store_config(path.as_path(), Some(&passphrase))
+                .map_err::<matrix_sdk::StoreError, _>(Into::into)?;
+            let config = ClientConfig::with_store_config(store_config)
                 // force_auth option to solve an issue with some servers configuration to require
                 // auth for profiles:
                 // https://gitlab.gnome.org/GNOME/fractal/-/issues/934
-                .request_config(RequestConfig::new().retry_limit(2).force_auth())
-                .passphrase(passphrase.clone())
-                .store_path(path.clone());
+                .request_config(RequestConfig::new().retry_limit(2).force_auth());
 
             let config = if use_discovery {
                 config.use_discovery_response()
@@ -359,13 +358,14 @@ impl Session {
 
     pub fn login_with_previous_session(&self, session: StoredSession) {
         let handle = spawn_tokio!(async move {
-            let config = ClientConfig::new()
+            let store_config =
+                make_store_config(session.path.as_path(), Some(&session.secret.passphrase))
+                    .map_err::<matrix_sdk::StoreError, _>(Into::into)?;
+            let config = ClientConfig::with_store_config(store_config)
                 // force_auth option to solve an issue with some servers configuration to require
                 // auth for profiles:
                 // https://gitlab.gnome.org/GNOME/fractal/-/issues/934
-                .request_config(RequestConfig::new().retry_limit(2).force_auth())
-                .passphrase(session.secret.passphrase.clone())
-                .store_path(session.path.clone());
+                .request_config(RequestConfig::new().retry_limit(2).force_auth());
 
             let client = Client::new_with_config(session.homeserver.clone(), config).await?;
             client
@@ -699,7 +699,7 @@ impl Session {
 
         let client = self.client();
         let handle = spawn_tokio!(async move {
-            let request = logout::Request::new();
+            let request = logout::v3::Request::new();
             client.send(request, None).await
         });
 
diff --git a/src/session/room/mod.rs b/src/session/room/mod.rs
index 29b7aeea2..82b57780a 100644
--- a/src/session/room/mod.rs
+++ b/src/session/room/mod.rs
@@ -20,7 +20,7 @@ use matrix_sdk::{
     deserialized_responses::{JoinedRoom, LeftRoom, SyncRoomEvent},
     room::Room as MatrixRoom,
     ruma::{
-        api::client::r0::sync::sync_events::InvitedRoom,
+        api::client::sync::sync_events::v3::InvitedRoom,
         events::{
             reaction::{Relation, SyncReactionEvent},
             room::{
@@ -32,15 +32,14 @@ use matrix_sdk::{
             },
             tag::{TagInfo, TagName},
             AnyRoomAccountDataEvent, AnyStateEventContent, AnyStrippedStateEvent,
-            AnySyncMessageEvent, AnySyncRoomEvent, AnySyncStateEvent, EventType, SyncMessageEvent,
-            Unsigned,
+            AnySyncMessageEvent, AnySyncRoomEvent, AnySyncStateEvent, StateEventType,
+            SyncMessageEvent, Unsigned,
         },
         identifiers::{EventId, RoomId, TransactionId, UserId},
         serde::Raw,
         MilliSecondsSinceUnixEpoch,
     },
 };
-use serde_json::value::RawValue;
 
 pub use self::{
     event::Event,
@@ -878,7 +877,7 @@ impl Room {
         let matrix_room = self.matrix_room();
         let handle = spawn_tokio!(async move {
             let state_event = match matrix_room
-                .get_state_event(EventType::RoomPowerLevels, "")
+                .get_state_event(StateEventType::RoomPowerLevels, "")
                 .await
             {
                 Ok(state_event) => state_event,
@@ -913,9 +912,7 @@ impl Room {
     fn send_room_message_event(&self, event: AnySyncMessageEvent, txn_id: Box<TransactionId>) {
         if let MatrixRoom::Joined(matrix_room) = self.matrix_room() {
             let content = event.content();
-            let json = serde_json::to_string(&AnySyncRoomEvent::Message(event)).unwrap();
-            let raw_event: Raw<AnySyncRoomEvent> =
-                Raw::from_json(RawValue::from_string(json).unwrap());
+            let raw_event: Raw<AnySyncRoomEvent> = Raw::new(&content).unwrap().cast();
             let event = Event::new(raw_event.into(), self);
             self.imp()
                 .timeline
@@ -975,19 +972,17 @@ impl Room {
         } else {
             RoomRedactionEventContent::new()
         };
-        let event = AnySyncMessageEvent::RoomRedaction(SyncRoomRedactionEvent {
+        let event = SyncRoomRedactionEvent {
             content,
             redacts: redacted_event_id.clone(),
             event_id,
             sender: self.session().user().unwrap().user_id().as_ref().to_owned(),
             origin_server_ts: MilliSecondsSinceUnixEpoch::now(),
             unsigned: Unsigned::default(),
-        });
+        };
 
         if let MatrixRoom::Joined(matrix_room) = self.matrix_room() {
-            let json = serde_json::to_string(&AnySyncRoomEvent::Message(event)).unwrap();
-            let raw_event: Raw<AnySyncRoomEvent> =
-                Raw::from_json(RawValue::from_string(json).unwrap());
+            let raw_event: Raw<AnySyncRoomEvent> = Raw::new(&event).unwrap().cast();
             let event = Event::new(raw_event.into(), self);
             self.imp()
                 .timeline
diff --git a/src/session/room_creation/mod.rs b/src/session/room_creation/mod.rs
index 5bbab8307..2f84b7fb4 100644
--- a/src/session/room_creation/mod.rs
+++ b/src/session/room_creation/mod.rs
@@ -9,7 +9,7 @@ use matrix_sdk::{
         api::{
             client::{
                 error::ErrorKind as RumaClientErrorKind,
-                r0::room::{create_room, Visibility},
+                room::{create_room, Visibility},
             },
             error::{FromHttpResponseError, ServerError},
         },
@@ -226,7 +226,7 @@ impl RoomCreation {
             // We don't allow invalid room names to be entered by the user
             let name = room_name.as_str().try_into().unwrap();
 
-            let request = assign!(create_room::Request::new(),
+            let request = assign!(create_room::v3::Request::new(),
             {
                 name: Some(name),
                 visibility,
diff --git a/src/session/verification/verification_list.rs b/src/session/verification/verification_list.rs
index abef25a3f..987db11ac 100644
--- a/src/session/verification/verification_list.rs
+++ b/src/session/verification/verification_list.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
 use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*};
 use log::{debug, warn};
 use matrix_sdk::ruma::{
-    api::client::r0::sync::sync_events::ToDevice, events::AnyToDeviceEvent, identifiers::UserId,
+    api::client::sync::sync_events::v3::ToDevice, events::AnyToDeviceEvent, identifiers::UserId,
 };
 
 use crate::session::{


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]