summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock595
-rw-r--r--Cargo.toml8
-rw-r--r--Cross.toml23
-rw-r--r--src/api/client_server/context.rs19
-rw-r--r--src/api/client_server/media.rs6
-rw-r--r--src/api/client_server/message.rs8
-rw-r--r--src/api/client_server/mod.rs2
-rw-r--r--src/api/client_server/relations.rs10
-rw-r--r--src/api/client_server/threads.rs49
-rw-r--r--src/api/client_server/unversioned.rs2
-rw-r--r--src/api/server_server.rs4
-rw-r--r--src/database/key_value/rooms/mod.rs1
-rw-r--r--src/database/key_value/rooms/pdu_metadata.rs7
-rw-r--r--src/database/key_value/rooms/threads.rs78
-rw-r--r--src/database/key_value/rooms/timeline.rs21
-rw-r--r--src/database/mod.rs7
-rw-r--r--src/main.rs1
-rw-r--r--src/service/media/mod.rs6
-rw-r--r--src/service/mod.rs1
-rw-r--r--src/service/pdu.rs30
-rw-r--r--src/service/pusher/mod.rs4
-rw-r--r--src/service/rooms/mod.rs3
-rw-r--r--src/service/rooms/pdu_metadata/data.rs1
-rw-r--r--src/service/rooms/pdu_metadata/mod.rs9
-rw-r--r--src/service/rooms/threads/data.rs15
-rw-r--r--src/service/rooms/threads/mod.rs119
-rw-r--r--src/service/rooms/timeline/data.rs7
-rw-r--r--src/service/rooms/timeline/mod.rs68
28 files changed, 765 insertions, 339 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9c86f7d..ebb47d9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -21,33 +21,24 @@ dependencies = [
[[package]]
name = "aho-corasick"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04"
+checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
dependencies = [
"memchr",
]
[[package]]
-name = "alloc-no-stdlib"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
-
-[[package]]
-name = "alloc-stdlib"
-version = "0.2.2"
+name = "allocator-api2"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
-dependencies = [
- "alloc-no-stdlib",
-]
+checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9"
[[package]]
name = "anstyle"
-version = "1.0.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d"
+checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
[[package]]
name = "arc-swap"
@@ -63,9 +54,9 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
[[package]]
name = "arrayvec"
-version = "0.7.2"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
+checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "assign"
@@ -79,12 +70,12 @@ version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a"
dependencies = [
- "brotli",
- "flate2",
"futures-core",
"memchr",
"pin-project-lite",
"tokio",
+ "zstd",
+ "zstd-safe",
]
[[package]]
@@ -95,7 +86,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -118,7 +109,7 @@ checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43"
dependencies = [
"async-trait",
"axum-core",
- "bitflags",
+ "bitflags 1.3.2",
"bytes",
"futures-util",
"headers",
@@ -137,7 +128,7 @@ dependencies = [
"sync_wrapper",
"tokio",
"tower",
- "tower-http",
+ "tower-http 0.3.5",
"tower-layer",
"tower-service",
]
@@ -160,9 +151,9 @@ dependencies = [
[[package]]
name = "axum-server"
-version = "0.4.7"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bace45b270e36e3c27a190c65883de6dfc9f1d18c829907c127464815dc67b24"
+checksum = "447f28c85900215cc1bea282f32d4a2f22d55c5a300afdfbc661c8d6a632e063"
dependencies = [
"arc-swap",
"bytes",
@@ -171,10 +162,10 @@ dependencies = [
"http-body",
"hyper",
"pin-project-lite",
- "rustls",
+ "rustls 0.21.2",
"rustls-pemfile 1.0.2",
"tokio",
- "tokio-rustls",
+ "tokio-rustls 0.24.1",
"tower-service",
]
@@ -186,9 +177,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
-version = "0.21.0"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
+checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
[[package]]
name = "base64ct"
@@ -211,7 +202,7 @@ version = "0.65.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"cexpr",
"clang-sys",
"lazy_static",
@@ -223,7 +214,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -233,6 +224,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
+name = "bitflags"
+version = "2.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded"
+
+[[package]]
name = "blake2b_simd"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -240,7 +237,7 @@ checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc"
dependencies = [
"arrayref",
"arrayvec",
- "constant_time_eq 0.2.5",
+ "constant_time_eq 0.2.6",
]
[[package]]
@@ -262,31 +259,10 @@ dependencies = [
]
[[package]]
-name = "brotli"
-version = "3.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
- "brotli-decompressor",
-]
-
-[[package]]
-name = "brotli-decompressor"
-version = "2.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
-]
-
-[[package]]
name = "bumpalo"
-version = "3.12.2"
+version = "3.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
+checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
[[package]]
name = "bytemuck"
@@ -354,9 +330,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.3.0"
+version = "4.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc"
+checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211"
dependencies = [
"clap_builder",
"clap_derive",
@@ -365,25 +341,25 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.3.0"
+version = "4.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990"
+checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717"
dependencies = [
"anstyle",
- "bitflags",
+ "bitflags 1.3.2",
"clap_lex",
]
[[package]]
name = "clap_derive"
-version = "4.3.0"
+version = "4.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b"
+checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f"
dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -445,7 +421,7 @@ dependencies = [
"tikv-jemallocator",
"tokio",
"tower",
- "tower-http",
+ "tower-http 0.4.1",
"tracing",
"tracing-flame",
"tracing-opentelemetry",
@@ -467,9 +443,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "constant_time_eq"
-version = "0.2.5"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b"
+checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6"
[[package]]
name = "core-foundation"
@@ -489,9 +465,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]]
name = "cpufeatures"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58"
+checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
dependencies = [
"libc",
]
@@ -557,9 +533,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
-version = "0.9.14"
+version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
+checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
dependencies = [
"autocfg",
"cfg-if",
@@ -580,9 +556,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
-version = "0.8.15"
+version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b"
+checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [
"cfg-if",
]
@@ -730,6 +706,12 @@ dependencies = [
]
[[package]]
+name = "equivalent"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1"
+
+[[package]]
name = "fallible-iterator"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -752,14 +734,14 @@ dependencies = [
[[package]]
name = "figment"
-version = "0.10.8"
+version = "0.10.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9"
+checksum = "4547e226f4c9ab860571e070a9034192b3175580ecea38da34fcdb53a018c9a5"
dependencies = [
"atomic",
"pear",
"serde",
- "toml 0.5.11",
+ "toml",
"uncased",
"version_check",
]
@@ -782,9 +764,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "form_urlencoded"
-version = "1.1.0"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
+checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
dependencies = [
"percent-encoding",
]
@@ -855,7 +837,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -911,9 +893,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.9"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
+checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
dependencies = [
"cfg-if",
"libc",
@@ -948,7 +930,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http",
- "indexmap",
+ "indexmap 1.9.3",
"slab",
"tokio",
"tokio-util",
@@ -963,20 +945,21 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
-version = "0.13.2"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
+checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
dependencies = [
"ahash",
+ "allocator-api2",
]
[[package]]
name = "hashlink"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0761a1b9491c4f2e3d66aa0f62d0fba0af9a0e2852e4d48ea506632a4b56e6aa"
+checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f"
dependencies = [
- "hashbrown 0.13.2",
+ "hashbrown 0.14.0",
]
[[package]]
@@ -986,7 +969,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584"
dependencies = [
"base64 0.13.1",
- "bitflags",
+ "bitflags 1.3.2",
"bytes",
"headers-core",
"http",
@@ -1132,7 +1115,7 @@ dependencies = [
"httpdate",
"itoa",
"pin-project-lite",
- "socket2",
+ "socket2 0.4.9",
"tokio",
"tower-service",
"tracing",
@@ -1147,9 +1130,9 @@ checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
dependencies = [
"http",
"hyper",
- "rustls",
+ "rustls 0.20.8",
"tokio",
- "tokio-rustls",
+ "tokio-rustls 0.23.4",
]
[[package]]
@@ -1165,9 +1148,9 @@ dependencies = [
[[package]]
name = "idna"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
+checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
dependencies = [
"unicode-bidi",
"unicode-normalization",
@@ -1201,6 +1184,16 @@ dependencies = [
]
[[package]]
+name = "indexmap"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
+dependencies = [
+ "equivalent",
+ "hashbrown 0.14.0",
+]
+
+[[package]]
name = "inlinable_string"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1214,14 +1207,14 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02"
[[package]]
name = "ipconfig"
-version = "0.3.1"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be"
+checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
dependencies = [
- "socket2",
+ "socket2 0.5.3",
"widestring",
- "winapi",
- "winreg 0.10.1",
+ "windows-sys 0.48.0",
+ "winreg 0.50.0",
]
[[package]]
@@ -1262,9 +1255,9 @@ checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"
[[package]]
name = "js-sys"
-version = "0.3.63"
+version = "0.3.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
+checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
dependencies = [
"wasm-bindgen",
]
@@ -1293,7 +1286,7 @@ version = "8.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378"
dependencies = [
- "base64 0.21.0",
+ "base64 0.21.2",
"pem",
"ring",
"serde",
@@ -1337,9 +1330,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.144"
+version = "0.2.146"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
[[package]]
name = "libloading"
@@ -1408,9 +1401,9 @@ dependencies = [
[[package]]
name = "lock_api"
-version = "0.4.9"
+version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
+checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
dependencies = [
"autocfg",
"scopeguard",
@@ -1418,12 +1411,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.17"
+version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
-dependencies = [
- "cfg-if",
-]
+checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
[[package]]
name = "lru-cache"
@@ -1485,9 +1475,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memoffset"
-version = "0.8.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
+checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
@@ -1516,14 +1506,13 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.8.6"
+version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
+checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
- "log",
"wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys 0.45.0",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -1599,9 +1588,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.17.1"
+version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
+checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]]
name = "opaque-debug"
@@ -1660,7 +1649,7 @@ dependencies = [
"fnv",
"futures-channel",
"futures-util",
- "indexmap",
+ "indexmap 1.9.3",
"js-sys",
"once_cell",
"pin-project-lite",
@@ -1726,15 +1715,15 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.7"
+version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
+checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall",
+ "redox_syscall 0.3.5",
"smallvec",
- "windows-sys 0.45.0",
+ "windows-targets",
]
[[package]]
@@ -1763,7 +1752,7 @@ dependencies = [
"proc-macro2",
"proc-macro2-diagnostics",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -1783,9 +1772,9 @@ dependencies = [
[[package]]
name = "percent-encoding"
-version = "2.2.0"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
+checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]]
name = "persy"
@@ -1820,7 +1809,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -1853,11 +1842,11 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
[[package]]
name = "png"
-version = "0.17.8"
+version = "0.17.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa"
+checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"crc32fast",
"fdeflate",
"flate2",
@@ -1872,12 +1861,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prettyplease"
-version = "0.2.5"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "617feabb81566b593beb4886fb8c1f38064169dae4dccad0e3220160c3b37203"
+checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282"
dependencies = [
"proc-macro2",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -1892,9 +1881,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.58"
+version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8"
+checksum = "363a6f739a0c0addeaf6ed75150b95743aa18643a3c6f40409ed7b6db3a6911f"
dependencies = [
"unicode-ident",
]
@@ -1907,7 +1896,7 @@ checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
"version_check",
"yansi",
]
@@ -1920,9 +1909,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quote"
-version = "1.0.27"
+version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
+checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
dependencies = [
"proc-macro2",
]
@@ -1986,7 +1975,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.9",
+ "getrandom 0.2.10",
]
[[package]]
@@ -2004,7 +1993,16 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
+dependencies = [
+ "bitflags 1.3.2",
]
[[package]]
@@ -2013,20 +2011,20 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
- "getrandom 0.2.9",
- "redox_syscall",
+ "getrandom 0.2.10",
+ "redox_syscall 0.2.16",
"thiserror",
]
[[package]]
name = "regex"
-version = "1.8.1"
+version = "1.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370"
+checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
dependencies = [
"aho-corasick",
"memchr",
- "regex-syntax 0.7.1",
+ "regex-syntax 0.7.2",
]
[[package]]
@@ -2046,9 +2044,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
+checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
[[package]]
name = "reqwest"
@@ -2072,14 +2070,14 @@ dependencies = [
"mime",
"percent-encoding",
"pin-project-lite",
- "rustls",
+ "rustls 0.20.8",
"rustls-native-certs",
"rustls-pemfile 0.2.1",
"serde",
"serde_json",
"serde_urlencoded",
"tokio",
- "tokio-rustls",
+ "tokio-rustls 0.23.4",
"tokio-socks",
"url",
"wasm-bindgen",
@@ -2126,7 +2124,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.8.2"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"assign",
"js_int",
@@ -2144,7 +2142,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
version = "0.8.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"js_int",
"ruma-common",
@@ -2155,7 +2153,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.16.2"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"assign",
"bytes",
@@ -2172,13 +2170,13 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.11.3"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
- "base64 0.21.0",
+ "base64 0.21.2",
"bytes",
"form_urlencoded",
"http",
- "indexmap",
+ "indexmap 1.9.3",
"js_int",
"js_option",
"konst",
@@ -2200,7 +2198,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.7.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"js_int",
"ruma-common",
@@ -2211,7 +2209,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.9.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"js_int",
"thiserror",
@@ -2220,7 +2218,7 @@ dependencies = [
[[package]]
name = "ruma-identity-service-api"
version = "0.7.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"js_int",
"ruma-common",
@@ -2230,7 +2228,7 @@ dependencies = [
[[package]]
name = "ruma-macros"
version = "0.11.3"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"once_cell",
"proc-macro-crate",
@@ -2238,14 +2236,14 @@ dependencies = [
"quote",
"ruma-identifiers-validation",
"serde",
- "syn 1.0.109",
- "toml 0.7.4",
+ "syn 2.0.21",
+ "toml",
]
[[package]]
name = "ruma-push-gateway-api"
version = "0.7.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"js_int",
"ruma-common",
@@ -2256,15 +2254,15 @@ dependencies = [
[[package]]
name = "ruma-signatures"
version = "0.13.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
- "base64 0.21.0",
+ "base64 0.21.2",
"ed25519-dalek",
"pkcs8",
"rand 0.7.3",
"ruma-common",
"serde_json",
- "sha2 0.10.6",
+ "sha2 0.10.7",
"subslice",
"thiserror",
]
@@ -2272,7 +2270,7 @@ dependencies = [
[[package]]
name = "ruma-state-res"
version = "0.9.1"
-source = "git+https://github.com/ruma/ruma?rev=8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5#8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5"
+source = "git+https://github.com/ruma/ruma?rev=761771a317460f30590da170115d007892381e85#761771a317460f30590da170115d007892381e85"
dependencies = [
"itertools",
"js_int",
@@ -2289,7 +2287,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
@@ -2328,10 +2326,22 @@ dependencies = [
]
[[package]]
+name = "rustls"
+version = "0.21.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f"
+dependencies = [
+ "log",
+ "ring",
+ "rustls-webpki",
+ "sct",
+]
+
+[[package]]
name = "rustls-native-certs"
-version = "0.6.2"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50"
+checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
dependencies = [
"openssl-probe",
"rustls-pemfile 1.0.2",
@@ -2354,7 +2364,17 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
dependencies = [
- "base64 0.21.0",
+ "base64 0.21.2",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.100.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
+dependencies = [
+ "ring",
+ "untrusted",
]
[[package]]
@@ -2400,7 +2420,7 @@ version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"core-foundation",
"core-foundation-sys",
"libc",
@@ -2419,22 +2439,22 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.163"
+version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
+checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.163"
+version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
+checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -2444,7 +2464,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53192e38d5c88564b924dbe9b60865ecbb71b81d38c4e61c817cffd3e36ef696"
dependencies = [
"form_urlencoded",
- "indexmap",
+ "indexmap 1.9.3",
"itoa",
"ryu",
"serde",
@@ -2452,9 +2472,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.96"
+version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
+checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
dependencies = [
"itoa",
"ryu",
@@ -2463,9 +2483,9 @@ dependencies = [
[[package]]
name = "serde_spanned"
-version = "0.6.2"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d"
+checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"
dependencies = [
"serde",
]
@@ -2484,11 +2504,11 @@ dependencies = [
[[package]]
name = "serde_yaml"
-version = "0.9.21"
+version = "0.9.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c"
+checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85"
dependencies = [
- "indexmap",
+ "indexmap 2.0.0",
"itoa",
"ryu",
"serde",
@@ -2532,9 +2552,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.10.6"
+version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
+checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -2615,6 +2635,16 @@ dependencies = [
]
[[package]]
+name = "socket2"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877"
+dependencies = [
+ "libc",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
name = "spin"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2658,9 +2688,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.16"
+version = "2.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01"
+checksum = "1182caafaab7018eaea9b404afa8184c0baf42a04d5e10ae4f4843c2029c8aab"
dependencies = [
"proc-macro2",
"quote",
@@ -2699,7 +2729,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -2767,9 +2797,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.21"
+version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
+checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
dependencies = [
"itoa",
"serde",
@@ -2809,9 +2839,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.28.1"
+version = "1.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105"
+checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2"
dependencies = [
"autocfg",
"bytes",
@@ -2820,7 +2850,7 @@ dependencies = [
"num_cpus",
"pin-project-lite",
"signal-hook-registry",
- "socket2",
+ "socket2 0.4.9",
"tokio-macros",
"windows-sys 0.48.0",
]
@@ -2833,7 +2863,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -2842,12 +2872,22 @@ version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [
- "rustls",
+ "rustls 0.20.8",
"tokio",
"webpki",
]
[[package]]
+name = "tokio-rustls"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
+dependencies = [
+ "rustls 0.21.2",
+ "tokio",
+]
+
+[[package]]
name = "tokio-socks"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2886,18 +2926,9 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.5.11"
+version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec"
+checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240"
dependencies = [
"serde",
"serde_spanned",
@@ -2907,20 +2938,20 @@ dependencies = [
[[package]]
name = "toml_datetime"
-version = "0.6.2"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
+checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
-version = "0.19.9"
+version = "0.19.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f"
+checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7"
dependencies = [
- "indexmap",
+ "indexmap 2.0.0",
"serde",
"serde_spanned",
"toml_datetime",
@@ -2949,8 +2980,27 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
dependencies = [
+ "bitflags 1.3.2",
+ "bytes",
+ "futures-core",
+ "futures-util",
+ "http",
+ "http-body",
+ "http-range-header",
+ "pin-project-lite",
+ "tower",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8bd22a874a2d0b70452d5597b12c537331d49060824a95f49f108994f94aa4c"
+dependencies = [
"async-compression",
- "bitflags",
+ "bitflags 2.3.2",
"bytes",
"futures-core",
"futures-util",
@@ -2993,13 +3043,13 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.24"
+version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74"
+checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -3140,9 +3190,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
[[package]]
name = "unicode-ident"
-version = "1.0.8"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
+checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
[[package]]
name = "unicode-normalization"
@@ -3173,22 +3223,22 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]]
name = "url"
-version = "2.3.1"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
+checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
dependencies = [
"form_urlencoded",
- "idna 0.3.0",
+ "idna 0.4.0",
"percent-encoding",
]
[[package]]
name = "uuid"
-version = "1.3.3"
+version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2"
+checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81"
dependencies = [
- "getrandom 0.2.9",
+ "getrandom 0.2.10",
]
[[package]]
@@ -3211,11 +3261,10 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "want"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
dependencies = [
- "log",
"try-lock",
]
@@ -3233,9 +3282,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -3243,24 +3292,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.36"
+version = "0.4.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
+checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03"
dependencies = [
"cfg-if",
"js-sys",
@@ -3270,9 +3319,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -3280,28 +3329,28 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
[[package]]
name = "web-sys"
-version = "0.3.63"
+version = "0.3.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
+checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -3325,9 +3374,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
[[package]]
name = "widestring"
-version = "0.5.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983"
+checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8"
[[package]]
name = "wildmatch"
@@ -3374,35 +3423,11 @@ dependencies = [
[[package]]
name = "windows-sys"
-version = "0.45.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
-dependencies = [
- "windows-targets 0.42.2",
-]
-
-[[package]]
-name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
- "windows-targets 0.48.0",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
+ "windows-targets",
]
[[package]]
@@ -3506,9 +3531,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winnow"
-version = "0.4.6"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699"
+checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448"
dependencies = [
"memchr",
]
@@ -3524,11 +3549,12 @@ dependencies = [
[[package]]
name = "winreg"
-version = "0.10.1"
+version = "0.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
+checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [
- "winapi",
+ "cfg-if",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -3554,7 +3580,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.16",
+ "syn 2.0.21",
]
[[package]]
@@ -3567,6 +3593,25 @@ dependencies = [
]
[[package]]
+name = "zstd"
+version = "0.11.2+zstd.1.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
+dependencies = [
+ "zstd-safe",
+]
+
+[[package]]
+name = "zstd-safe"
+version = "5.0.2+zstd.1.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
+dependencies = [
+ "libc",
+ "zstd-sys",
+]
+
+[[package]]
name = "zstd-sys"
version = "2.0.8+zstd.1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index c925bf2..12e9109 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,14 +19,14 @@ rust-version = "1.64.0"
[dependencies]
# Web framework
-axum = { version = "0.5.17", default-features = false, features = ["form", "headers", "http1", "http2", "json", "matched-path"], optional = true }
-axum-server = { version = "0.4.7", features = ["tls-rustls"] }
+axum = { version = "0.5.16", default-features = false, features = ["form", "headers", "http1", "http2", "json", "matched-path"], optional = true }
+axum-server = { version = "0.5.1", features = ["tls-rustls"] }
tower = { version = "0.4.13", features = ["util"] }
-tower-http = { version = "0.3.5", features = ["add-extension", "cors", "compression-full", "sensitive-headers", "trace", "util"] }
+tower-http = { version = "0.4.1", features = ["add-extension", "cors", "compression-zstd", "sensitive-headers", "trace", "util"] }
# Used for matrix spec type definitions and helpers
#ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
-ruma = { git = "https://github.com/ruma/ruma", rev = "8eea3e05490fa9a318f9ed66c3a75272e6ef0ee5", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified" ] }
+ruma = { git = "https://github.com/ruma/ruma", rev = "761771a317460f30590da170115d007892381e85", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified" ] }
#ruma = { git = "https://github.com/timokoesters/ruma", rev = "50c1db7e0a3a21fc794b0cce3b64285a4c750c71", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { path = "../ruma/crates/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
diff --git a/Cross.toml b/Cross.toml
deleted file mode 100644
index 5d99a35..0000000
--- a/Cross.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-[build.env]
-# CI uses an S3 endpoint to store sccache artifacts, so their config needs to
-# be available in the cross container as well
-passthrough = [
- "RUSTC_WRAPPER",
- "AWS_ACCESS_KEY_ID",
- "AWS_SECRET_ACCESS_KEY",
- "SCCACHE_BUCKET",
- "SCCACHE_ENDPOINT",
- "SCCACHE_S3_USE_SSL",
-]
-
-[target.aarch64-unknown-linux-musl]
-image = "registry.gitlab.com/jfowl/conduit-containers/rust-cross-aarch64-unknown-linux-musl:latest"
-
-[target.arm-unknown-linux-musleabihf]
-image = "registry.gitlab.com/jfowl/conduit-containers/rust-cross-arm-unknown-linux-musleabihf:latest"
-
-[target.armv7-unknown-linux-musleabihf]
-image = "registry.gitlab.com/jfowl/conduit-containers/rust-cross-armv7-unknown-linux-musleabihf:latest"
-
-[target.x86_64-unknown-linux-musl]
-image = "registry.gitlab.com/jfowl/conduit-containers/rust-cross-x86_64-unknown-linux-musl@sha256:b6d689e42f0236c8a38b961bca2a12086018b85ed20e0826310421daf182e2bb"
diff --git a/src/api/client_server/context.rs b/src/api/client_server/context.rs
index 5a3013b..a824ea0 100644
--- a/src/api/client_server/context.rs
+++ b/src/api/client_server/context.rs
@@ -69,18 +69,18 @@ pub async fn get_context_route(
lazy_loaded.insert(base_event.sender.as_str().to_owned());
}
+ // Use limit with maximum 100
+ let limit = usize::try_from(body.limit)
+ .map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, "Limit value is invalid."))?
+ .min(100);
+
let base_event = base_event.to_room_event();
let events_before: Vec<_> = services()
.rooms
.timeline
.pdus_until(sender_user, &room_id, base_token)?
- .take(
- u32::try_from(body.limit).map_err(|_| {
- Error::BadRequest(ErrorKind::InvalidParam, "Limit value is invalid.")
- })? as usize
- / 2,
- )
+ .take(limit / 2)
.filter_map(|r| r.ok()) // Remove buggy events
.filter(|(_, pdu)| {
services()
@@ -114,12 +114,7 @@ pub async fn get_context_route(
.rooms
.timeline
.pdus_after(sender_user, &room_id, base_token)?
- .take(
- u32::try_from(body.limit).map_err(|_| {
- Error::BadRequest(ErrorKind::InvalidParam, "Limit value is invalid.")
- })? as usize
- / 2,
- )
+ .take(limit / 2)
.filter_map(|r| r.ok()) // Remove buggy events
.filter(|(_, pdu)| {
services()
diff --git a/src/api/client_server/media.rs b/src/api/client_server/media.rs
index 3410cc0..75f8e15 100644
--- a/src/api/client_server/media.rs
+++ b/src/api/client_server/media.rs
@@ -1,3 +1,5 @@
+use std::time::Duration;
+
use crate::{service::media::FileMeta, services, utils, Error, Result, Ruma};
use ruma::api::client::{
error::ErrorKind,
@@ -67,6 +69,8 @@ pub async fn get_remote_content(
allow_remote: false,
server_name: server_name.to_owned(),
media_id,
+ timeout_ms: Duration::from_secs(20),
+ allow_redirect: false,
},
)
.await?;
@@ -194,6 +198,8 @@ pub async fn get_content_thumbnail_route(
method: body.method.clone(),
server_name: body.server_name.clone(),
media_id: body.media_id.clone(),
+ timeout_ms: Duration::from_secs(20),
+ allow_redirect: false,
},
)
.await?;
diff --git a/src/api/client_server/message.rs b/src/api/client_server/message.rs
index faf178d..dc2d994 100644
--- a/src/api/client_server/message.rs
+++ b/src/api/client_server/message.rs
@@ -133,8 +133,12 @@ pub async fn get_message_events_route(
from,
)?;
- // Use limit or else 10
- let limit = body.limit.try_into().map_or(10_usize, |l: u32| l as usize);
+ // Use limit or else 10, with maximum 100
+ let limit = body
+ .limit
+ .try_into()
+ .map_or(10_usize, |l: u32| l as usize)
+ .min(100);
let next_token;
diff --git a/src/api/client_server/mod.rs b/src/api/client_server/mod.rs
index 6ed17e7..4a77f23 100644
--- a/src/api/client_server/mod.rs
+++ b/src/api/client_server/mod.rs
@@ -24,6 +24,7 @@ mod state;
mod sync;
mod tag;
mod thirdparty;
+mod threads;
mod to_device;
mod typing;
mod unversioned;
@@ -56,6 +57,7 @@ pub use state::*;
pub use sync::*;
pub use tag::*;
pub use thirdparty::*;
+pub use threads::*;
pub use to_device::*;
pub use typing::*;
pub use unversioned::*;
diff --git a/src/api/client_server/relations.rs b/src/api/client_server/relations.rs
new file mode 100644
index 0000000..4d2af47
--- /dev/null
+++ b/src/api/client_server/relations.rs
@@ -0,0 +1,10 @@
+use crate::{services, Result, Ruma};
+use std::time::{Duration, SystemTime};
+
+/// # `GET /_matrix/client/r0/todo`
+pub async fn get_relating_events_route(
+ body: Ruma<get_turn_server_info::v3::Request>,
+) -> Result<get_turn_server_info::v3::Response> {
+ let sender_user = body.sender_user.as_ref().expect("user is authenticated");
+ todo!();
+}
diff --git a/src/api/client_server/threads.rs b/src/api/client_server/threads.rs
new file mode 100644
index 0000000..a095b42
--- /dev/null
+++ b/src/api/client_server/threads.rs
@@ -0,0 +1,49 @@
+use ruma::api::client::{error::ErrorKind, threads::get_threads};
+
+use crate::{services, Error, Result, Ruma};
+
+/// # `GET /_matrix/client/r0/rooms/{roomId}/threads`
+pub async fn get_threads_route(
+ body: Ruma<get_threads::v1::Request>,
+) -> Result<get_threads::v1::Response> {
+ let sender_user = body.sender_user.as_ref().expect("user is authenticated");
+
+ // Use limit or else 10, with maximum 100
+ let limit = body
+ .limit
+ .and_then(|l| l.try_into().ok())
+ .unwrap_or(10)
+ .min(100);
+
+ let from = if let Some(from) = &body.from {
+ from.parse()
+ .map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, ""))?
+ } else {
+ u64::MAX
+ };
+
+ let threads = services()
+ .rooms
+ .threads
+ .threads_until(sender_user, &body.room_id, from, &body.include)?
+ .take(limit)
+ .filter_map(|r| r.ok())
+ .filter(|(_, pdu)| {
+ services()
+ .rooms
+ .state_accessor
+ .user_can_see_event(sender_user, &body.room_id, &pdu.event_id)
+ .unwrap_or(false)
+ })
+ .collect::<Vec<_>>();
+
+ let next_batch = threads.last().map(|(count, _)| count.to_string());
+
+ Ok(get_threads::v1::Response {
+ chunk: threads
+ .into_iter()
+ .map(|(_, pdu)| pdu.to_room_event())
+ .collect(),
+ next_batch,
+ })
+}
diff --git a/src/api/client_server/unversioned.rs b/src/api/client_server/unversioned.rs
index 526598b..b4f03f4 100644
--- a/src/api/client_server/unversioned.rs
+++ b/src/api/client_server/unversioned.rs
@@ -23,6 +23,8 @@ pub async fn get_supported_versions_route(
"r0.6.0".to_owned(),
"v1.1".to_owned(),
"v1.2".to_owned(),
+ "v1.3".to_owned(),
+ "v1.4".to_owned(),
],
unstable_features: BTreeMap::from_iter([("org.matrix.e2e_cross_signing".to_owned(), true)]),
};
diff --git a/src/api/server_server.rs b/src/api/server_server.rs
index 961b658..c1c23a5 100644
--- a/src/api/server_server.rs
+++ b/src/api/server_server.rs
@@ -1,3 +1,4 @@
+#[allow(deprecated)]
use crate::{
api::client_server::{self, claim_keys_helper, get_keys_helper},
service::pdu::{gen_event_id_canonical_json, PduBuilder},
@@ -497,6 +498,9 @@ async fn request_well_known(destination: &str) -> Option<String> {
.send()
.await;
debug!("Got well known response");
+ if let Err(e) = &response {
+ error!("Well known error: {e:?}");
+ }
let text = response.ok()?.text().await;
debug!("Got well known response text");
let body: serde_json::Value = serde_json::from_str(&text.ok()?).ok()?;
diff --git a/src/database/key_value/rooms/mod.rs b/src/database/key_value/rooms/mod.rs
index 406943e..e7b53d3 100644
--- a/src/database/key_value/rooms/mod.rs
+++ b/src/database/key_value/rooms/mod.rs
@@ -12,6 +12,7 @@ mod state;
mod state_accessor;
mod state_cache;
mod state_compressor;
+mod threads;
mod timeline;
mod user;
diff --git a/src/database/key_value/rooms/pdu_metadata.rs b/src/database/key_value/rooms/pdu_metadata.rs
index 76ec734..4b3f810 100644
--- a/src/database/key_value/rooms/pdu_metadata.rs
+++ b/src/database/key_value/rooms/pdu_metadata.rs
@@ -5,6 +5,13 @@ use ruma::{EventId, RoomId};
use crate::{database::KeyValueDatabase, service, Result};
impl service::rooms::pdu_metadata::Data for KeyValueDatabase {
+ fn add_relation(&self, from: u64, to: u64) -> Result<()> {
+ let mut key = from.to_be_bytes().to_vec();
+ key.extend_from_slice(&to.to_be_bytes());
+ self.fromto_relation.insert(&key, &[])?;
+ Ok(())
+ }
+
fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()> {
for prev in event_ids {
let mut key = room_id.as_bytes().to_vec();
diff --git a/src/database/key_value/rooms/threads.rs b/src/database/key_value/rooms/threads.rs
new file mode 100644
index 0000000..4be289b
--- /dev/null
+++ b/src/database/key_value/rooms/threads.rs
@@ -0,0 +1,78 @@
+use std::mem;
+
+use ruma::{api::client::threads::get_threads::v1::IncludeThreads, OwnedUserId, RoomId, UserId};
+
+use crate::{database::KeyValueDatabase, service, services, utils, Error, PduEvent, Result};
+
+impl service::rooms::threads::Data for KeyValueDatabase {
+ fn threads_until<'a>(
+ &'a self,
+ user_id: &'a UserId,
+ room_id: &'a RoomId,
+ until: u64,
+ include: &'a IncludeThreads,
+ ) -> Result<Box<dyn Iterator<Item = Result<(u64, PduEvent)>> + 'a>> {
+ let prefix = services()
+ .rooms
+ .short
+ .get_shortroomid(room_id)?
+ .expect("room exists")
+ .to_be_bytes()
+ .to_vec();
+
+ let mut current = prefix.clone();
+ current.extend_from_slice(&(until - 1).to_be_bytes());
+
+ Ok(Box::new(
+ self.threadid_userids
+ .iter_from(&current, true)
+ .take_while(move |(k, _)| k.starts_with(&prefix))
+ .map(move |(pduid, users)| {
+ let count = utils::u64_from_bytes(&pduid[(mem::size_of::<u64>())..])
+ .map_err(|_| Error::bad_database("Invalid pduid in threadid_userids."))?;
+ let mut pdu = services()
+ .rooms
+ .timeline
+ .get_pdu_from_id(&pduid)?
+ .ok_or_else(|| {
+ Error::bad_database("Invalid pduid reference in threadid_userids")
+ })?;
+ if pdu.sender != user_id {
+ pdu.remove_transaction_id()?;
+ }
+ Ok((count, pdu))
+ }),
+ ))
+ }
+
+ fn update_participants(&self, root_id: &[u8], participants: &[OwnedUserId]) -> Result<()> {
+ let users = participants
+ .iter()
+ .map(|user| user.as_bytes())
+ .collect::<Vec<_>>()
+ .join(&[0xff][..]);
+
+ self.threadid_userids.insert(&root_id, &users)?;
+
+ Ok(())
+ }
+
+ fn get_participants(&self, root_id: &[u8]) -> Result<Option<Vec<OwnedUserId>>> {
+ if let Some(users) = self.threadid_userids.get(&root_id)? {
+ Ok(Some(
+ users
+ .split(|b| *b == 0xff)
+ .map(|bytes| {
+ UserId::parse(utils::string_from_bytes(bytes).map_err(|_| {
+ Error::bad_database("Invalid UserId bytes in threadid_userids.")
+ })?)
+ .map_err(|_| Error::bad_database("Invalid UserId in threadid_userids."))
+ })
+ .filter_map(|r| r.ok())
+ .collect(),
+ ))
+ } else {
+ Ok(None)
+ }
+ }
+}
diff --git a/src/database/key_value/rooms/timeline.rs b/src/database/key_value/rooms/timeline.rs
index d9c4423..74e3e5c 100644
--- a/src/database/key_value/rooms/timeline.rs
+++ b/src/database/key_value/rooms/timeline.rs
@@ -198,19 +198,30 @@ impl service::rooms::timeline::Data for KeyValueDatabase {
}
/// Removes a pdu and creates a new one with the same id.
- fn replace_pdu(&self, pdu_id: &[u8], pdu: &PduEvent) -> Result<()> {
+ fn replace_pdu(
+ &self,
+ pdu_id: &[u8],
+ pdu_json: &CanonicalJsonObject,
+ pdu: &PduEvent,
+ ) -> Result<()> {
if self.pduid_pdu.get(pdu_id)?.is_some() {
self.pduid_pdu.insert(
pdu_id,
- &serde_json::to_vec(pdu).expect("CanonicalJsonObject is always a valid"),
+ &serde_json::to_vec(pdu_json).expect("CanonicalJsonObject is always a valid"),
)?;
- Ok(())
} else {
- Err(Error::BadRequest(
+ return Err(Error::BadRequest(
ErrorKind::NotFound,
"PDU does not exist.",
- ))
+ ));
}
+
+ self.pdu_cache
+ .lock()
+ .unwrap()
+ .remove(&(*pdu.event_id).to_owned());
+
+ Ok(())
}
/// Returns an iterator over all events and their tokens in a room that happened before the
diff --git a/src/database/mod.rs b/src/database/mod.rs
index 1415f68..b864ceb 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -80,6 +80,8 @@ pub struct KeyValueDatabase {
pub(super) aliasid_alias: Arc<dyn KvTree>, // AliasId = RoomId + Count
pub(super) publicroomids: Arc<dyn KvTree>,
+ pub(super) threadid_userids: Arc<dyn KvTree>, // ThreadId = RoomId + Count
+
pub(super) tokenids: Arc<dyn KvTree>, // TokenId = ShortRoomId + Token + PduIdCount
/// Participating servers in a room.
@@ -128,6 +130,8 @@ pub struct KeyValueDatabase {
pub(super) eventid_outlierpdu: Arc<dyn KvTree>,
pub(super) softfailedeventids: Arc<dyn KvTree>,
+ /// ShortEventId + ShortEventId -> ().
+ pub(super) fromto_relation: Arc<dyn KvTree>,
/// RoomId + EventId -> Parent PDU EventId.
pub(super) referencedevents: Arc<dyn KvTree>,
@@ -302,6 +306,8 @@ impl KeyValueDatabase {
aliasid_alias: builder.open_tree("aliasid_alias")?,
publicroomids: builder.open_tree("publicroomids")?,
+ threadid_userids: builder.open_tree("threadid_userids")?,
+
tokenids: builder.open_tree("tokenids")?,
roomserverids: builder.open_tree("roomserverids")?,
@@ -342,6 +348,7 @@ impl KeyValueDatabase {
eventid_outlierpdu: builder.open_tree("eventid_outlierpdu")?,
softfailedeventids: builder.open_tree("softfailedeventids")?,
+ fromto_relation: builder.open_tree("fromto_relation")?,
referencedevents: builder.open_tree("referencedevents")?,
roomuserdataid_accountdata: builder.open_tree("roomuserdataid_accountdata")?,
roomusertype_roomuserdataid: builder.open_tree("roomusertype_roomuserdataid")?,
diff --git a/src/main.rs b/src/main.rs
index 59e82a7..edb7640 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -383,6 +383,7 @@ fn routes() -> Router {
.ruma_route(client_server::set_pushers_route)
// .ruma_route(client_server::third_party_route)
.ruma_route(client_server::upgrade_room_route)
+ .ruma_route(client_server::get_threads_route)
.ruma_route(server_server::get_server_version_route)
.route(
"/_matrix/key/v2/server",
diff --git a/src/service/media/mod.rs b/src/service/media/mod.rs
index 9393753..fc8fa56 100644
--- a/src/service/media/mod.rs
+++ b/src/service/media/mod.rs
@@ -8,7 +8,7 @@ use image::imageops::FilterType;
use tokio::{
fs::File,
- io::{AsyncReadExt, AsyncWriteExt},
+ io::{AsyncReadExt, AsyncWriteExt, BufReader},
};
pub struct FileMeta {
@@ -70,7 +70,9 @@ impl Service {
{
let path = services().globals.get_media_file(&key);
let mut file = Vec::new();
- File::open(path).await?.read_to_end(&mut file).await?;
+ BufReader::new(File::open(path).await?)
+ .read_to_end(&mut file)
+ .await?;
Ok(Some(FileMeta {
content_disposition,
diff --git a/src/service/mod.rs b/src/service/mod.rs
index eea397f..3b48810 100644
--- a/src/service/mod.rs
+++ b/src/service/mod.rs
@@ -97,6 +97,7 @@ impl Services {
db,
lasttimelinecount_cache: Mutex::new(HashMap::new()),
},
+ threads: rooms::threads::Service { db },
user: rooms::user::Service { db },
},
transaction_ids: transaction_ids::Service { db },
diff --git a/src/service/pdu.rs b/src/service/pdu.rs
index a497b11..9d284c0 100644
--- a/src/service/pdu.rs
+++ b/src/service/pdu.rs
@@ -1,9 +1,9 @@
use crate::Error;
use ruma::{
events::{
- room::member::RoomMemberEventContent, AnyEphemeralRoomEvent, AnyStateEvent,
- AnyStrippedStateEvent, AnySyncStateEvent, AnySyncTimelineEvent, AnyTimelineEvent,
- StateEvent, TimelineEventType,
+ room::member::RoomMemberEventContent, AnyEphemeralRoomEvent, AnyMessageLikeEvent,
+ AnyStateEvent, AnyStrippedStateEvent, AnySyncStateEvent, AnySyncTimelineEvent,
+ AnyTimelineEvent, StateEvent, TimelineEventType,
},
serde::Raw,
state_res, CanonicalJsonObject, CanonicalJsonValue, EventId, MilliSecondsSinceUnixEpoch,
@@ -176,6 +176,30 @@ impl PduEvent {
}
#[tracing::instrument(skip(self))]
+ pub fn to_message_like_event(&self) -> Raw<AnyMessageLikeEvent> {
+ let mut json = json!({
+ "content": self.content,
+ "type": self.kind,
+ "event_id": self.event_id,
+ "sender": self.sender,
+ "origin_server_ts": self.origin_server_ts,
+ "room_id": self.room_id,
+ });
+
+ if let Some(unsigned) = &self.unsigned {
+ json["unsigned"] = json!(unsigned);
+ }
+ if let Some(state_key) = &self.state_key {
+ json["state_key"] = json!(state_key);
+ }
+ if let Some(redacts) = &self.redacts {
+ json["redacts"] = json!(redacts);
+ }
+
+ serde_json::from_value(json).expect("Raw::from_value always works")
+ }
+
+ #[tracing::instrument(skip(self))]
pub fn to_state_event(&self) -> Raw<AnyStateEvent> {
let mut json = json!({
"content": self.content,
diff --git a/src/service/pusher/mod.rs b/src/service/pusher/mod.rs
index 5933c03..d4acaa5 100644
--- a/src/service/pusher/mod.rs
+++ b/src/service/pusher/mod.rs
@@ -162,9 +162,7 @@ impl Service {
&pdu.room_id,
)? {
let n = match action {
- Action::DontNotify => false,
- // TODO: Implement proper support for coalesce
- Action::Notify | Action::Coalesce => true,
+ Action::Notify => true,
Action::SetTweak(tweak) => {
tweaks.push(tweak.clone());
continue;
diff --git a/src/service/rooms/mod.rs b/src/service/rooms/mod.rs
index 8956e4d..61304d1 100644
--- a/src/service/rooms/mod.rs
+++ b/src/service/rooms/mod.rs
@@ -13,6 +13,7 @@ pub mod state;
pub mod state_accessor;
pub mod state_cache;
pub mod state_compressor;
+pub mod threads;
pub mod timeline;
pub mod user;
@@ -32,6 +33,7 @@ pub trait Data:
+ state_cache::Data
+ state_compressor::Data
+ timeline::Data
+ + threads::Data
+ user::Data
{
}
@@ -53,5 +55,6 @@ pub struct Service {
pub state_cache: state_cache::Service,
pub state_compressor: state_compressor::Service,
pub timeline: timeline::Service,
+ pub threads: threads::Service,
pub user: user::Service,
}
diff --git a/src/service/rooms/pdu_metadata/data.rs b/src/service/rooms/pdu_metadata/data.rs
index b157938..5577b3e 100644
--- a/src/service/rooms/pdu_metadata/data.rs
+++ b/src/service/rooms/pdu_metadata/data.rs
@@ -4,6 +4,7 @@ use crate::Result;
use ruma::{EventId, RoomId};
pub trait Data: Send + Sync {
+ fn add_relation(&self, from: u64, to: u64) -> Result<()>;
fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()>;
fn is_event_referenced(&self, room_id: &RoomId, event_id: &EventId) -> Result<bool>;
fn mark_event_soft_failed(&self, event_id: &EventId) -> Result<()>;
diff --git a/src/service/rooms/pdu_metadata/mod.rs b/src/service/rooms/pdu_metadata/mod.rs
index b816678..a82b9a6 100644
--- a/src/service/rooms/pdu_metadata/mod.rs
+++ b/src/service/rooms/pdu_metadata/mod.rs
@@ -4,13 +4,20 @@ use std::sync::Arc;
pub use data::Data;
use ruma::{EventId, RoomId};
-use crate::Result;
+use crate::{services, Result};
pub struct Service {
pub db: &'static dyn Data,
}
impl Service {
+ #[tracing::instrument(skip(self, from, to))]
+ pub fn add_relation(&self, from: &EventId, to: &EventId) -> Result<()> {
+ let from = services().rooms.short.get_or_create_shorteventid(from)?;
+ let to = services().rooms.short.get_or_create_shorteventid(to)?;
+ self.db.add_relation(from, to)
+ }
+
#[tracing::instrument(skip(self, room_id, event_ids))]
pub fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()> {
self.db.mark_as_referenced(room_id, event_ids)
diff --git a/src/service/rooms/threads/data.rs b/src/service/rooms/threads/data.rs
new file mode 100644
index 0000000..9221e8e
--- /dev/null
+++ b/src/service/rooms/threads/data.rs
@@ -0,0 +1,15 @@
+use crate::{PduEvent, Result};
+use ruma::{api::client::threads::get_threads::v1::IncludeThreads, OwnedUserId, RoomId, UserId};
+
+pub trait Data: Send + Sync {
+ fn threads_until<'a>(
+ &'a self,
+ user_id: &'a UserId,
+ room_id: &'a RoomId,
+ until: u64,
+ include: &'a IncludeThreads,
+ ) -> Result<Box<dyn Iterator<Item = Result<(u64, PduEvent)>> + 'a>>;
+
+ fn update_participants(&self, root_id: &[u8], participants: &[OwnedUserId]) -> Result<()>;
+ fn get_participants(&self, root_id: &[u8]) -> Result<Option<Vec<OwnedUserId>>>;
+}
diff --git a/src/service/rooms/threads/mod.rs b/src/service/rooms/threads/mod.rs
new file mode 100644
index 0000000..241927a
--- /dev/null
+++ b/src/service/rooms/threads/mod.rs
@@ -0,0 +1,119 @@
+mod data;
+use std::sync::Arc;
+
+pub use data::Data;
+use ruma::{
+ api::client::{error::ErrorKind, threads::get_threads::v1::IncludeThreads},
+ events::{relation::BundledThread, StateEventType},
+ uint, CanonicalJsonValue, EventId, OwnedUserId, RoomId, UserId,
+};
+use serde::Deserialize;
+use serde_json::json;
+
+use crate::{services, utils, Error, PduEvent, Result};
+
+use super::timeline::PduCount;
+
+pub struct Service {
+ pub db: &'static dyn Data,
+}
+
+impl Service {
+ pub fn threads_until<'a>(
+ &'a self,
+ user_id: &'a UserId,
+ room_id: &'a RoomId,
+ until: u64,
+ include: &'a IncludeThreads,
+ ) -> Result<impl Iterator<Item = Result<(u64, PduEvent)>> + 'a> {
+ self.db.threads_until(user_id, room_id, until, include)
+ }
+
+ pub fn add_to_thread<'a>(&'a self, root_event_id: &EventId, pdu: &PduEvent) -> Result<()> {
+ let root_id = &services()
+ .rooms
+ .timeline
+ .get_pdu_id(root_event_id)?
+ .ok_or_else(|| {
+ Error::BadRequest(
+ ErrorKind::InvalidParam,
+ "Invalid event id in thread message",
+ )
+ })?;
+
+ let root_pdu = services()
+ .rooms
+ .timeline
+ .get_pdu_from_id(root_id)?
+ .ok_or_else(|| {
+ Error::BadRequest(ErrorKind::InvalidParam, "Thread root pdu not found")
+ })?;
+
+ let mut root_pdu_json = services()
+ .rooms
+ .timeline
+ .get_pdu_json_from_id(root_id)?
+ .ok_or_else(|| {
+ Error::BadRequest(ErrorKind::InvalidParam, "Thread root pdu not found")
+ })?;
+
+ if let CanonicalJsonValue::Object(unsigned) = root_pdu_json
+ .entry("unsigned".to_owned())
+ .or_insert_with(|| CanonicalJsonValue::Object(Default::default()))
+ {
+ if let Some(mut relations) = unsigned
+ .get("m.relations")
+ .and_then(|r| r.as_object())
+ .and_then(|r| r.get("m.thread"))
+ .and_then(|relations| {
+ serde_json::from_value::<BundledThread>(relations.clone().into()).ok()
+ })
+ {
+ // Thread already existed
+ relations.count += uint!(1);
+ relations.latest_event = pdu.to_message_like_event();
+
+ let content = serde_json::to_value(relations).expect("to_value always works");
+
+ unsigned.insert(
+ "m.relations".to_owned(),
+ json!({ "m.thread": content })
+ .try_into()
+ .expect("thread is valid json"),
+ );
+ } else {
+ // New thread
+ let relations = BundledThread {
+ latest_event: pdu.to_message_like_event(),
+ count: uint!(1),
+ current_user_participated: true,
+ };
+
+ let content = serde_json::to_value(relations).expect("to_value always works");
+
+ unsigned.insert(
+ "m.relations".to_owned(),
+ json!({ "m.thread": content })
+ .try_into()
+ .expect("thread is valid json"),
+ );
+ }
+
+ services()
+ .rooms
+ .timeline
+ .replace_pdu(root_id, &root_pdu_json, &root_pdu)?;
+ }
+
+ let mut users = Vec::new();
+ if let Some(userids) = self.db.get_participants(&root_id)? {
+ users.extend_from_slice(&userids);
+ users.push(pdu.sender.clone());
+ } else {
+ users.push(root_pdu.sender);
+ users.push(pdu.sender.clone());
+ }
+
+ self.db.update_participants(root_id, &users)
+ }
+}
diff --git a/src/service/rooms/timeline/data.rs b/src/service/rooms/timeline/data.rs
index 193f384..afa2cfb 100644
--- a/src/service/rooms/timeline/data.rs
+++ b/src/service/rooms/timeline/data.rs
@@ -57,7 +57,12 @@ pub trait Data: Send + Sync {
) -> Result<()>;
/// Removes a pdu and creates a new one with the same id.
- fn replace_pdu(&self, pdu_id: &[u8], pdu: &PduEvent) -> Result<()>;
+ fn replace_pdu(
+ &self,
+ pdu_id: &[u8],
+ pdu_json: &CanonicalJsonObject,
+ pdu: &PduEvent,
+ ) -> Result<()>;
/// Returns an iterator over all events and their tokens in a room that happened before the
/// event with id `until` in reverse-chronological order.
diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs
index 2ffd3a6..0547fcf 100644
--- a/src/service/rooms/timeline/mod.rs
+++ b/src/service/rooms/timeline/mod.rs
@@ -18,13 +18,13 @@ use ruma::{
events::{
push_rules::PushRulesEvent,
room::{
- create::RoomCreateEventContent, member::MembershipState,
+ create::RoomCreateEventContent, encrypted::Relation, member::MembershipState,
power_levels::RoomPowerLevelsEventContent,
},
GlobalAccountDataEventType, StateEventType, TimelineEventType,
},
push::{Action, Ruleset, Tweak},
- serde::Base64,
+ serde::{Base64, JsonObject},
state_res,
state_res::{Event, RoomVersion},
uint, user_id, CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
@@ -197,8 +197,13 @@ impl Service {
/// Removes a pdu and creates a new one with the same id.
#[tracing::instrument(skip(self))]
- fn replace_pdu(&self, pdu_id: &[u8], pdu: &PduEvent) -> Result<()> {
- self.db.replace_pdu(pdu_id, pdu)
+ pub fn replace_pdu(
+ &self,
+ pdu_id: &[u8],
+ pdu_json: &CanonicalJsonObject,
+ pdu: &PduEvent,
+ ) -> Result<()> {
+ self.db.replace_pdu(pdu_id, pdu_json, pdu)
}
/// Creates a new persisted data unit and adds it to a room.
@@ -352,9 +357,7 @@ impl Service {
&pdu.room_id,
)? {
match action {
- Action::DontNotify => notify = false,
- // TODO: Implement proper support for coalesce
- Action::Notify | Action::Coalesce => notify = true,
+ Action::Notify => notify = true,
Action::SetTweak(Tweak::Highlight(true)) => {
highlight = true;
}
@@ -457,6 +460,50 @@ impl Service {
_ => {}
}
+ // Update Relationships
+ #[derive(Deserialize)]
+ struct ExtractRelatesTo {
+ #[serde(rename = "m.relates_to")]
+ relates_to: Relation,
+ }
+
+ #[derive(Clone, Debug, Deserialize)]
+ struct ExtractEventId {
+ event_id: OwnedEventId,
+ }
+ #[derive(Clone, Debug, Deserialize)]
+ struct ExtractRelatesToEventId {
+ #[serde(rename = "m.relates_to")]
+ relates_to: ExtractEventId,
+ }
+
+ if let Ok(content) = serde_json::from_str::<ExtractRelatesToEventId>(pdu.content.get()) {
+ services()
+ .rooms
+ .pdu_metadata
+ .add_relation(&pdu.event_id, &content.relates_to.event_id)?;
+ }
+
+ if let Ok(content) = serde_json::from_str::<ExtractRelatesTo>(pdu.content.get()) {
+ match content.relates_to {
+ Relation::Reply { in_reply_to } => {
+ // We need to do it again here, because replies don't have
+ // event_id as a top level field
+ services()
+ .rooms
+ .pdu_metadata
+ .add_relation(&pdu.event_id, &in_reply_to.event_id)?;
+ }
+ Relation::Thread(thread) => {
+ services()
+ .rooms
+ .threads
+ .add_to_thread(&thread.event_id, pdu)?;
+ }
+ _ => {} // TODO: Aggregate other types
+ }
+ }
+
for appservice in services().appservice.all()? {
if services()
.rooms
@@ -957,12 +1004,17 @@ impl Service {
/// Replace a PDU with the redacted form.
#[tracing::instrument(skip(self, reason))]
pub fn redact_pdu(&self, event_id: &EventId, reason: &PduEvent) -> Result<()> {
+ // TODO: Don't reserialize, keep original json
if let Some(pdu_id) = self.get_pdu_id(event_id)? {
let mut pdu = self
.get_pdu_from_id(&pdu_id)?
.ok_or_else(|| Error::bad_database("PDU ID points to invalid PDU."))?;
pdu.redact(reason)?;
- self.replace_pdu(&pdu_id, &pdu)?;
+ self.replace_pdu(
+ &pdu_id,
+ &utils::to_canonical_object(&pdu).expect("PDU is an object"),
+ &pdu,
+ )?;
}
// If event does not exist, just noop
Ok(())