From 30172cd487f2df85a13c3d5ca8eaa5f3f677013f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 14 Feb 2024 10:10:36 +0100 Subject: [PATCH] chore: Upgrade matrix-sdk and ruma crates --- Cargo.lock | 380 ++++++++++++++++-- Cargo.toml | 6 +- src/session/model/room/mod.rs | 12 +- src/session/model/room/timeline/mod.rs | 14 +- src/session/model/room_list/mod.rs | 8 +- src/session/model/session.rs | 2 +- .../room_details/history_viewer/audio_row.rs | 2 +- .../room_details/history_viewer/media_item.rs | 4 +- .../content/room_history/message_row/audio.rs | 2 +- .../content/room_history/message_row/media.rs | 4 +- src/utils/matrix.rs | 8 +- 11 files changed, 385 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9576d83e..fa1a71b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,6 +173,47 @@ dependencies = [ "zbus", ] +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", +] + +[[package]] +name = "askama_derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.48", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] + [[package]] name = "assign" version = "1.1.1" @@ -446,6 +487,24 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "basic-toml" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bindgen" version = "0.66.1" @@ -483,6 +542,9 @@ name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +dependencies = [ + "serde", +] [[package]] name = "bitmaps" @@ -606,6 +668,38 @@ dependencies = [ "system-deps", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cbc" version = "0.1.2" @@ -1528,6 +1622,15 @@ dependencies = [ "url", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "futf" version = "0.1.5" @@ -1952,6 +2055,17 @@ dependencies = [ "system-deps", ] +[[package]] +name = "goblin" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb07a4ffed2093b118a525b1d8f5204ae274faed5604537caf7135d0f18d9887" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "graphene-rs" version = "0.19.0" @@ -2548,7 +2662,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -3370,7 +3484,7 @@ dependencies = [ [[package]] name = "matrix-sdk" version = "0.7.1" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "anymap2", "aquamarine", @@ -3395,6 +3509,7 @@ dependencies = [ "image", "imbl", "indexmap 2.1.0", + "js_int", "language-tags", "mas-oidc-client", "matrix-sdk-base", @@ -3425,7 +3540,7 @@ dependencies = [ [[package]] name = "matrix-sdk-base" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "as_variant", "async-trait", @@ -3443,12 +3558,13 @@ dependencies = [ "thiserror", "tokio", "tracing", + "uniffi", ] [[package]] name = "matrix-sdk-common" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "async-trait", "futures-core", @@ -3470,7 +3586,7 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "aes", "as_variant", @@ -3508,7 +3624,7 @@ dependencies = [ [[package]] name = "matrix-sdk-indexeddb" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "anyhow", "async-trait", @@ -3533,7 +3649,7 @@ dependencies = [ [[package]] name = "matrix-sdk-qrcode" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "byteorder", "qrcode", @@ -3545,7 +3661,7 @@ dependencies = [ [[package]] name = "matrix-sdk-sqlite" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "async-trait", "deadpool-sqlite", @@ -3567,8 +3683,9 @@ dependencies = [ [[package]] name = "matrix-sdk-store-encryption" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ + "base64", "blake3", "chacha20poly1305", "displaydoc", @@ -3586,7 +3703,7 @@ dependencies = [ [[package]] name = "matrix-sdk-ui" version = "0.7.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=eec52d7977c6122879a2d25f6ea81d76ea754280#eec52d7977c6122879a2d25f6ea81d76ea754280" +source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=74931768e59d610588e9916289193aadffadad47#74931768e59d610588e9916289193aadffadad47" dependencies = [ "as_variant", "async-once-cell", @@ -3925,6 +4042,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "oneshot-uniffi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" + [[package]] name = "oo7" version = "0.2.2" @@ -4438,6 +4561,12 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "platforms" version = "3.3.0" @@ -4894,7 +5023,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.9.4" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "assign", "js_int", @@ -4910,7 +5039,7 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.17.4" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "as_variant", "assign", @@ -4929,7 +5058,7 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.12.1" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "as_variant", "base64", @@ -4959,7 +5088,7 @@ dependencies = [ [[package]] name = "ruma-events" version = "0.27.11" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "as_variant", "indexmap 2.1.0", @@ -4983,7 +5112,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.8.0" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "js_int", "ruma-common", @@ -4995,7 +5124,7 @@ dependencies = [ [[package]] name = "ruma-html" version = "0.1.0" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "as_variant", "html5ever", @@ -5007,7 +5136,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.9.3" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "js_int", "thiserror", @@ -5016,7 +5145,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.12.0" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "once_cell", "proc-macro-crate 2.0.0", @@ -5025,13 +5154,13 @@ dependencies = [ "ruma-identifiers-validation", "serde", "syn 2.0.48", - "toml", + "toml 0.8.2", ] [[package]] name = "ruma-push-gateway-api" version = "0.8.0" -source = "git+https://github.com/ruma/ruma.git?rev=684ffc789877355bd25269451b2356817c17cc3f#684ffc789877355bd25269451b2356817c17cc3f" +source = "git+https://github.com/ruma/ruma.git?rev=68c9bb0930f2195fa8672fbef9633ef62737df5d#68c9bb0930f2195fa8672fbef9633ef62737df5d" dependencies = [ "js_int", "ruma-common", @@ -5205,6 +5334,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "scrypt" version = "0.11.0" @@ -5277,12 +5426,15 @@ name = "semver" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -5309,9 +5461,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -5344,9 +5496,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -5497,6 +5649,12 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "socket2" version = "0.4.10" @@ -5718,7 +5876,7 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml", + "toml 0.8.2", "version-compare", ] @@ -5758,6 +5916,17 @@ dependencies = [ "utf-8", ] +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.56" @@ -5931,6 +6100,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.2" @@ -6187,6 +6365,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-normalization" version = "0.1.22" @@ -6208,6 +6392,135 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "uniffi" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad0be8bba6c242d2d16922de4a9c8f167b9491729fda552e70f8626bf7302cb" +dependencies = [ + "anyhow", + "uniffi_core", + "uniffi_macros", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab31006ab9c9c6870739f0e74235729d1478d82e73571b8f53c25aa176d67535" +dependencies = [ + "anyhow", + "askama", + "camino", + "cargo_metadata", + "fs-err", + "glob", + "goblin", + "heck", + "once_cell", + "paste", + "serde", + "textwrap", + "toml 0.5.11", + "uniffi_meta", + "uniffi_testing", + "uniffi_udl", +] + +[[package]] +name = "uniffi_build" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa3a7608c6872dc1ce53199d816a24d2e19af952d82ce557ecc8692a4ae9cba" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen", +] + +[[package]] +name = "uniffi_checksum_derive" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72775b3afa6adb30e0c92b3107858d2fcb0ff1a417ac242db1f648b0e2dd0ef2" +dependencies = [ + "quote", + "syn 2.0.48", +] + +[[package]] +name = "uniffi_core" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d6e8db3f4e558faf0e25ac4b5bd775567973a4e18809f1123e74de52a853692" +dependencies = [ + "anyhow", + "bytes", + "camino", + "log", + "once_cell", + "oneshot-uniffi", + "paste", + "static_assertions", +] + +[[package]] +name = "uniffi_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a126650799f97d97d8e38e3f10f15c65f5bc5a76b021bec21823efe9dd831a02" +dependencies = [ + "bincode", + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.48", + "toml 0.5.11", + "uniffi_build", + "uniffi_meta", +] + +[[package]] +name = "uniffi_meta" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f64a99e905671738d9d293f9cce58708ce1af8e13ea29f9d6b6925114fc2e85" +dependencies = [ + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", +] + +[[package]] +name = "uniffi_testing" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdca5719a22edf34c8239cc6ac9e3906d7ebc2a3e8a5e6ece4c3dffc312a4251" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata", + "fs-err", + "once_cell", +] + +[[package]] +name = "uniffi_udl" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6817c15714acccd0d0459f99b524cabebfdd622376464a2c6466a6485bdb4b" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta", + "uniffi_testing", + "weedle2", +] + [[package]] name = "universal-hash" version = "0.5.1" @@ -6290,9 +6603,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vodozemac" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c66c59f2218deeddfe34c0fee8a1908967f8566bafd91c3c6b9600d0b68cde1" +checksum = "2790dffeecc522299d72d9a855c43adb0c23ba1dc1112d79a651fdf3beb2a356" dependencies = [ "aes", "arrayvec", @@ -6437,6 +6750,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "weedle2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" +dependencies = [ + "nom", +] + [[package]] name = "weezl" version = "0.1.8" diff --git a/Cargo.toml b/Cargo.toml index ba77bf01..9c78baf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ sourceview = { package = "sourceview5", version = "0.8" } [dependencies.matrix-sdk] git = "https://github.com/matrix-org/matrix-rust-sdk.git" -rev = "eec52d7977c6122879a2d25f6ea81d76ea754280" +rev = "74931768e59d610588e9916289193aadffadad47" features = [ "socks", "sso-login", @@ -76,14 +76,14 @@ features = [ [dependencies.matrix-sdk-ui] git = "https://github.com/matrix-org/matrix-rust-sdk.git" -rev = "eec52d7977c6122879a2d25f6ea81d76ea754280" +rev = "74931768e59d610588e9916289193aadffadad47" default-features = false features = ["e2e-encryption", "native-tls"] [dependencies.ruma] # version = "0.9.4" git = "https://github.com/ruma/ruma.git" -rev = "684ffc789877355bd25269451b2356817c17cc3f" +rev = "68c9bb0930f2195fa8672fbef9633ef62737df5d" features = [ "unstable-unspecified", "client-api-c", diff --git a/src/session/model/room/mod.rs b/src/session/model/room/mod.rs index 230ebcd2..6ae52817 100644 --- a/src/session/model/room/mod.rs +++ b/src/session/model/room/mod.rs @@ -24,7 +24,7 @@ use matrix_sdk::{ deserialized_responses::{MemberEvent, SyncTimelineEvent}, event_handler::EventHandlerDropGuard, room::Room as MatrixRoom, - sync::{JoinedRoom, LeftRoom}, + sync::{JoinedRoomUpdate, LeftRoomUpdate}, DisplayName, Result as MatrixResult, RoomInfo, RoomMemberships, RoomState, }; use ruma::{ @@ -1439,12 +1439,12 @@ impl Room { })); } - pub fn handle_left_response(&self, response_room: LeftRoom) { - self.update_for_events(response_room.timeline.events); + pub fn handle_left_update(&self, update: LeftRoomUpdate) { + self.update_for_events(update.timeline.events); } - pub fn handle_joined_response(&self, response_room: JoinedRoom) { - if response_room + pub fn handle_joined_update(&self, update: JoinedRoomUpdate) { + if update .account_data .iter() .any(|e| matches!(e.deserialize(), Ok(AnyRoomAccountDataEvent::Tag(_)))) @@ -1452,7 +1452,7 @@ impl Room { self.load_category(); } - self.update_for_events(response_room.timeline.events); + self.update_for_events(update.timeline.events); } /// Connect to the signal emitted when the room was forgotten. diff --git a/src/session/model/room/timeline/mod.rs b/src/session/model/room/timeline/mod.rs index 65c9e7cf..9ef65ac4 100644 --- a/src/session/model/room/timeline/mod.rs +++ b/src/session/model/room/timeline/mod.rs @@ -538,7 +538,7 @@ impl Timeline { let room_id = room.room_id().to_owned(); let matrix_room = room.matrix_room().clone(); - let matrix_timeline = spawn_tokio!(async move { + let handle = spawn_tokio!(async move { matrix_room .timeline_builder() .event_filter(|any, room_version| { @@ -586,9 +586,15 @@ impl Timeline { .add_failed_to_parse(false) .build() .await - }) - .await - .unwrap(); + }); + + let matrix_timeline = match handle.await.unwrap() { + Ok(t) => t, + Err(error) => { + error!("Failed to create timeline: {error}"); + return; + } + }; let matrix_timeline = Arc::new(matrix_timeline); imp.timeline.set(matrix_timeline.clone()).unwrap(); diff --git a/src/session/model/room_list/mod.rs b/src/session/model/room_list/mod.rs index e2dbc710..21de550a 100644 --- a/src/session/model/room_list/mod.rs +++ b/src/session/model/room_list/mod.rs @@ -12,7 +12,7 @@ use gtk::{ use indexmap::map::IndexMap; use matrix_sdk::{ ruma::{OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomOrAliasId}, - sync::Rooms as ResponseRooms, + sync::RoomUpdates, }; use ruma::UserId; use tracing::{error, warn}; @@ -294,7 +294,7 @@ impl RoomList { self.items_added(added); } - pub fn handle_response_rooms(&self, rooms: ResponseRooms) { + pub fn handle_room_updates(&self, rooms: RoomUpdates) { let Some(session) = self.session() else { return; }; @@ -320,7 +320,7 @@ impl RoomList { self.pending_rooms_remove((*room_id).into()); room.update_room(); - room.handle_left_response(left_room); + room.handle_left_update(left_room); } for (room_id, joined_room) in rooms.join { @@ -341,7 +341,7 @@ impl RoomList { self.pending_rooms_remove((*room_id).into()); imp.metainfo.watch_room(&room); room.update_room(); - room.handle_joined_response(joined_room); + room.handle_joined_update(joined_room); } for (room_id, _invited_room) in rooms.invite { diff --git a/src/session/model/session.rs b/src/session/model/session.rs index 2b24c0fb..3507e3b5 100644 --- a/src/session/model/session.rs +++ b/src/session/model/session.rs @@ -413,7 +413,7 @@ impl Session { debug!("Received sync response"); match response { Ok(response) => { - self.room_list().handle_response_rooms(response.rooms); + self.room_list().handle_room_updates(response.rooms); if self.state() < SessionState::Ready { self.set_state(SessionState::Ready); diff --git a/src/session/view/content/room_details/history_viewer/audio_row.rs b/src/session/view/content/room_details/history_viewer/audio_row.rs index df56871f..09aa8c0a 100644 --- a/src/session/view/content/room_details/history_viewer/audio_row.rs +++ b/src/session/view/content/room_details/history_viewer/audio_row.rs @@ -122,7 +122,7 @@ glib::wrapper! { impl AudioRow { async fn download_audio(&self, audio: AudioMessageEventContent, session: &Session) { let client = session.client(); - let handle = spawn_tokio!(async move { client.media().get_file(audio, true).await }); + let handle = spawn_tokio!(async move { client.media().get_file(&audio, true).await }); match handle.await.unwrap() { Ok(Some(data)) => { diff --git a/src/session/view/content/room_details/history_viewer/media_item.rs b/src/session/view/content/room_details/history_viewer/media_item.rs index 524b8536..ee8d8e3c 100644 --- a/src/session/view/content/room_details/history_viewer/media_item.rs +++ b/src/session/view/content/room_details/history_viewer/media_item.rs @@ -173,7 +173,7 @@ impl MediaItem { let thumbnail = if content.thumbnail_source().is_some() { media .get_thumbnail( - content.clone(), + &content, MediaThumbnailSize { method: Method::Scale, width: uint!(300), @@ -191,7 +191,7 @@ impl MediaItem { if let Some(data) = thumbnail { Ok(Some(data)) } else { - media.get_file(content, true).await + media.get_file(&content, true).await } }); diff --git a/src/session/view/content/room_history/message_row/audio.rs b/src/session/view/content/room_history/message_row/audio.rs index 4af0030b..c9db48a1 100644 --- a/src/session/view/content/room_history/message_row/audio.rs +++ b/src/session/view/content/room_history/message_row/audio.rs @@ -163,7 +163,7 @@ impl MessageAudio { self.set_state(MediaState::Loading); let client = session.client(); - let handle = spawn_tokio!(async move { client.media().get_file(audio, true).await }); + let handle = spawn_tokio!(async move { client.media().get_file(&audio, true).await }); spawn!( glib::Priority::LOW, diff --git a/src/session/view/content/room_history/message_row/media.rs b/src/session/view/content/room_history/message_row/media.rs index 9be88ad2..cd8984c5 100644 --- a/src/session/view/content/room_history/message_row/media.rs +++ b/src/session/view/content/room_history/message_row/media.rs @@ -328,7 +328,7 @@ impl MessageMedia { if media_type != MediaType::Video && content.thumbnail_source().is_some() { media .get_thumbnail( - content.clone(), + &content, MediaThumbnailSize { method: Method::Scale, width: ((MAX_THUMBNAIL_WIDTH * scale_factor) as u32).into(), @@ -346,7 +346,7 @@ impl MessageMedia { if let Some(data) = thumbnail { Ok(Some(data)) } else { - media.get_file(content, true).await + media.get_file(&content, true).await } }); diff --git a/src/utils/matrix.rs b/src/utils/matrix.rs index ba0b975b..be6a2945 100644 --- a/src/utils/matrix.rs +++ b/src/utils/matrix.rs @@ -328,7 +328,7 @@ pub async fn get_media_content( None, ) }); - let handle = spawn_tokio!(async move { media.get_file(content, true).await }); + let handle = spawn_tokio!(async move { media.get_file(&content, true).await }); let data = handle.await.unwrap()?.unwrap(); Ok((filename, data)) } @@ -344,7 +344,7 @@ pub async fn get_media_content( } else { content.body.clone() }; - let handle = spawn_tokio!(async move { media.get_file(content, true).await }); + let handle = spawn_tokio!(async move { media.get_file(&content, true).await }); let data = handle.await.unwrap()?.unwrap(); Ok((filename, data)) } @@ -360,7 +360,7 @@ pub async fn get_media_content( } else { content.body.clone() }; - let handle = spawn_tokio!(async move { media.get_file(content, true).await }); + let handle = spawn_tokio!(async move { media.get_file(&content, true).await }); let data = handle.await.unwrap()?.unwrap(); Ok((filename, data)) } @@ -376,7 +376,7 @@ pub async fn get_media_content( } else { content.body.clone() }; - let handle = spawn_tokio!(async move { media.get_file(content, true).await }); + let handle = spawn_tokio!(async move { media.get_file(&content, true).await }); let data = handle.await.unwrap()?.unwrap(); Ok((filename, data)) }