Compare commits

..
13 changed files with 81 additions and 57 deletions

No files matched your search

+3 -4
View File
@@ -17,7 +17,7 @@ go to "files changed", and click on the "+" symbol in the line number gutter,
and attach comments to the lines that you think would benefit from some clarification.
-->
This pull request... <!-- do not forget to write here! -->
This pull request...
<!-- Example:
This pull request allows us to warp through time and space ten times faster than before by
@@ -26,8 +26,8 @@ efficient. This resolves the common issue where we have to wait more than 10 mil
engage, use, and disengage the warp drive when travelling between galaxies.
-->
<!-- Closes #... -->
<!-- Fixes #... -->
<!-- Closes: #... -->
<!-- Fixes: #... -->
<!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request
by superseding it. Replace `#...` with the issue/pr number, such as `#123`. -->
@@ -73,7 +73,6 @@ Notes on these requirements:
main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras!
-->
<!-- Do not delete below this line -->
[c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md
[c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx
[c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks
+1 -1
View File
@@ -64,7 +64,7 @@ repos:
- pre-push
- repo: https://code.forgejo.org/forgejo/runner
rev: v13.3.0
rev: v13.2.1
hooks:
- id: forgejo-runner-validate
stages:
Generated
+25 -25
View File
@@ -1026,7 +1026,7 @@ dependencies = [
"serde-saphyr",
"serde_json",
"serde_regex",
"sha2 0.11.3",
"sha2 0.11.2",
"smallstr",
"smallvec",
"thiserror 2.0.21",
@@ -1152,7 +1152,7 @@ dependencies = [
"serde-saphyr",
"serde_json",
"serde_urlencoded",
"sha2 0.11.3",
"sha2 0.11.2",
"termimad",
"tokio",
"tracing",
@@ -1866,7 +1866,7 @@ dependencies = [
"curve25519-dalek",
"ed25519",
"serde",
"sha2 0.11.3",
"sha2 0.11.2",
"signature 3.0.0",
"subtle",
"zeroize",
@@ -3245,9 +3245,9 @@ dependencies = [
[[package]]
name = "lettre"
version = "0.11.25"
version = "0.11.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15000d8223b52e56d577590183331413c0ef732ebdd9c9b6aebce15824aba899"
checksum = "f294f3d7cdb313e578acef7d7727d4e8d897e0fcd0d6d58c19959cec95073f19"
dependencies = [
"async-trait",
"base64 0.23.1",
@@ -4182,7 +4182,7 @@ dependencies = [
"elliptic-curve 0.14.3",
"primefield",
"primeorder 0.14.0",
"sha2 0.11.3",
"sha2 0.11.2",
]
[[package]]
@@ -4196,7 +4196,7 @@ dependencies = [
"fiat-crypto",
"primefield",
"primeorder 0.14.0",
"sha2 0.11.3",
"sha2 0.11.2",
]
[[package]]
@@ -5049,7 +5049,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.18.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"assign",
"js_int",
@@ -5068,7 +5068,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
version = "0.18.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"http",
"js_int",
@@ -5081,7 +5081,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.26.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"as_variant",
"assign",
@@ -5103,7 +5103,7 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.21.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"as_variant",
"base64 0.23.1",
@@ -5136,7 +5136,7 @@ dependencies = [
[[package]]
name = "ruma-events"
version = "0.36.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"as_variant",
"indexmap 2.14.2",
@@ -5157,7 +5157,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.17.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"bytes",
"http",
@@ -5179,7 +5179,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.14.1"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"js_int",
"thiserror 2.0.21",
@@ -5188,7 +5188,7 @@ dependencies = [
[[package]]
name = "ruma-macros"
version = "0.20.3"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"as_variant",
"cfg-if",
@@ -5204,7 +5204,7 @@ dependencies = [
[[package]]
name = "ruma-push-gateway-api"
version = "0.17.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"js_int",
"ruma-common",
@@ -5216,7 +5216,7 @@ dependencies = [
[[package]]
name = "ruma-signatures"
version = "0.23.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"base64 0.23.1",
"ed25519-dalek",
@@ -5226,14 +5226,14 @@ dependencies = [
"ruma-common",
"ruma-events",
"serde_json",
"sha2 0.11.3",
"sha2 0.11.2",
"thiserror 2.0.21",
]
[[package]]
name = "ruma-state-res"
version = "0.19.0"
source = "git+https://github.com/ruma/ruma.git?rev=1bb5d0663e8e64f096be3715aff7ee793d521e15#1bb5d0663e8e64f096be3715aff7ee793d521e15"
source = "git+https://github.com/ruma/ruma.git?rev=d6621e1355419c5ef9a7c260b28ae1c0e6722b86#d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
dependencies = [
"js_int",
"ruma-common",
@@ -5327,9 +5327,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.47"
version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ac0e747c10d93d873fd4c50b26ef47ad92d1bfb48f6922003bb514070f6e88c"
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"aws-lc-rs",
"log",
@@ -5704,7 +5704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "969cde0349344dbbf58b5f9badbfb8f806db13969364eb8007c057ef687007d9"
dependencies = [
"annotate-snippets",
"base64 0.22.1",
"base64 0.23.1",
"encoding_rs_io",
"granit-parser",
"nohash-hasher",
@@ -5909,9 +5909,9 @@ dependencies = [
[[package]]
name = "sha2"
version = "0.11.3"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "820083d430c52864bf834423fc988cbcf61685d6f9d22a765a64e3f6cfe3521c"
checksum = "5b0e5c7d67bc53f435386b2130fdc900488c5703770f6d8a4633060e34288a27"
dependencies = [
"cfg-if",
"cpufeatures 0.3.1",
@@ -7120,7 +7120,7 @@ dependencies = [
"hkdf 0.13.0",
"http",
"p256 0.13.2",
"sha2 0.11.3",
"sha2 0.11.2",
]
[[package]]
+1 -1
View File
@@ -357,7 +357,7 @@ version = "1.1.1"
# Used for matrix spec type definitions and helpers
[workspace.dependencies.ruma]
git = "https://github.com/ruma/ruma.git"
rev = "1bb5d0663e8e64f096be3715aff7ee793d521e15"
rev = "d6621e1355419c5ef9a7c260b28ae1c0e6722b86"
features = [
"appservice-api-c",
"client-api",
-1
View File
@@ -1 +0,0 @@
The `element_hacks` build feature, which has done almost nothing for many versions, has been removed completely. Contributed by @ginger.
+1 -1
View File
@@ -102,7 +102,7 @@ look like this:
RUSTFLAGS="--cfg tokio_unstable" cargo +nightly build \
--release \
--no-default-features \
--features=systemd,gzip_compression,brotli_compression,zstd_compression,tokio_console
--features=systemd,element_hacks,gzip_compression,brotli_compression,zstd_compression,tokio_console
```
You will also need to enable the `tokio_console` config option in Continuwuity
+1 -1
View File
@@ -146,7 +146,7 @@ cargo clippy \
--locked \
--profile test \
--no-default-features \
--features=console,systemd,direct_tls,perf_measurements,brotli_compression \
--features=console,systemd,element_hacks,direct_tls,perf_measurements,brotli_compression \
--color=always \
-- \
-D warnings
+3
View File
@@ -21,6 +21,9 @@ brotli_compression = [
"conduwuit-service/brotli_compression",
"reqwest/brotli",
]
element_hacks = [
"conduwuit-service/element_hacks",
]
gzip_compression = [
"conduwuit-core/gzip_compression",
"conduwuit-service/gzip_compression",
+5
View File
@@ -55,6 +55,7 @@ default = [
standard = [
"brotli_compression",
"direct_tls",
"element_hacks",
"gzip_compression",
"io_uring",
"jemalloc_conf",
@@ -85,6 +86,10 @@ console = [
direct_tls = [
"conduwuit-router/direct_tls"
]
element_hacks = [
"conduwuit-service/element_hacks",
"conduwuit-router/element_hacks",
]
gzip_compression = [
"conduwuit-core/gzip_compression",
"conduwuit-router/gzip_compression",
+3
View File
@@ -27,6 +27,9 @@ direct_tls = [
"axum-server/tls-rustls-no-provider",
"dep:axum-server-dual-protocol",
]
element_hacks = [
"conduwuit-api/element_hacks",
]
gzip_compression = [
"conduwuit-admin/gzip_compression",
"conduwuit-api/gzip_compression",
+1
View File
@@ -30,6 +30,7 @@ console = [
"dep:rustyline-async",
"dep:termimad",
]
element_hacks = []
gzip_compression = [
"conduwuit-core/gzip_compression",
"reqwest/gzip",
+2 -1
View File
@@ -75,7 +75,8 @@ impl Service {
"lazy loading should be enabled by your options"
);
let include_redundant = ctx.options.is_some_and(Options::include_redundant_members);
let include_redundant = cfg!(feature = "element_hacks")
|| ctx.options.is_some_and(Options::include_redundant_members);
let witness = self
.witness(ctx, senders.iter().map(AsRef::as_ref))
+35 -22
View File
@@ -112,31 +112,44 @@ impl Service {
query: &'a RoomQuery<'a>,
sender_user: &'a UserId,
) -> Result<(usize, impl Stream<Item = PduEvent> + Send + 'a)> {
let pdu_ids: Vec<_> = self.search_pdu_ids(query).await?.collect().await;
let (count, page) = if let Some(user_id) = query.user_id {
let filter = &query.criteria.filter;
self.search_pdu_ids(query)
.await?
.wide_filter_map(move |result_pdu_id: RawPduId| async move {
self.services
.timeline
.get_pdu_from_id(&result_pdu_id)
.await
.ok()
})
.ready_filter(|pdu| !pdu.is_redacted())
.ready_filter(move |pdu| filter.matches(pdu))
.wide_filter_map(move |pdu| async move {
self.services
.state_accessor
.user_can_see_event(user_id, &pdu.room_id_or_hash(), pdu.event_id())
.await
.then_some(pdu)
})
.ready_fold(
(0_usize, Vec::with_capacity(query.limit)),
|(mut count, mut page), pdu| {
if count >= query.skip && page.len() < query.limit {
page.push(pdu);
}
count = count.saturating_add(1);
(count, page)
},
)
.await
} else {
(0, Vec::new())
};
let filter = &query.criteria.filter;
let count = pdu_ids.len();
let pdus = pdu_ids
let pdus = page
.into_iter()
.stream()
.wide_filter_map(move |result_pdu_id: RawPduId| async move {
self.services
.timeline
.get_pdu_from_id(&result_pdu_id)
.await
.ok()
})
.ready_filter(|pdu| !pdu.is_redacted())
.ready_filter(move |pdu| filter.matches(pdu))
.wide_filter_map(move |pdu| async move {
self.services
.state_accessor
.user_can_see_event(query.user_id?, pdu.room_id().unwrap(), pdu.event_id())
.await
.then_some(pdu)
})
.skip(query.skip)
.take(query.limit)
.wide_filter_map(async move |mut pdu| {
let ctx = self
.services