mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Re-add support for MSC4293
This commit is contained in:
Generated
+12
-12
@@ -4640,7 +4640,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma"
|
||||
version = "0.14.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"js_int",
|
||||
@@ -4659,7 +4659,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-appservice-api"
|
||||
version = "0.14.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
@@ -4671,7 +4671,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-client-api"
|
||||
version = "0.22.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"assign",
|
||||
@@ -4693,7 +4693,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-common"
|
||||
version = "0.17.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"base64 0.22.1",
|
||||
@@ -4726,7 +4726,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-events"
|
||||
version = "0.32.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"indexmap",
|
||||
@@ -4747,7 +4747,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-federation-api"
|
||||
version = "0.13.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"headers",
|
||||
@@ -4770,7 +4770,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-identifiers-validation"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"thiserror 2.0.18",
|
||||
@@ -4779,7 +4779,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-macros"
|
||||
version = "0.17.1"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"cfg-if",
|
||||
@@ -4795,7 +4795,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-push-gateway-api"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
@@ -4807,7 +4807,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-signatures"
|
||||
version = "0.19.0"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"ed25519-dalek",
|
||||
@@ -4823,7 +4823,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-state-res"
|
||||
version = "0.15.0"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=985dec87f235f169b3adddf3a7d37f590403e6e9#985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
source = "git+https://github.com/ruma/ruma.git?rev=8b522a87b541be0802fb3c7820747a6869d37318#8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
@@ -4837,7 +4837,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ruminuwuity"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"ruma",
|
||||
|
||||
+2
-1
@@ -349,7 +349,7 @@ version = "1.1.1"
|
||||
[workspace.dependencies.ruma]
|
||||
# version = "0.14.1"
|
||||
git = "https://github.com/ruma/ruma.git"
|
||||
rev = "985dec87f235f169b3adddf3a7d37f590403e6e9"
|
||||
rev = "8b522a87b541be0802fb3c7820747a6869d37318"
|
||||
features = [
|
||||
"appservice-api-c",
|
||||
"client-api",
|
||||
@@ -382,6 +382,7 @@ features = [
|
||||
"unstable-msc4373",
|
||||
"unstable-msc4380",
|
||||
"unstable-msc4143",
|
||||
"unstable-msc4293",
|
||||
"unstable-msc4406",
|
||||
"unstable-msc4439",
|
||||
"unstable-extensible-events",
|
||||
|
||||
@@ -34,8 +34,8 @@ pub(crate) async fn ban_user_route(
|
||||
PartialPdu::state(
|
||||
body.user_id.to_string(),
|
||||
&assign!(RoomMemberEventContent::new(MembershipState::Ban), {
|
||||
reason: body.reason.clone()
|
||||
// TODO(upstream): MSC4293
|
||||
reason: body.reason.clone(),
|
||||
redact_events: body.redact_events,
|
||||
}),
|
||||
),
|
||||
sender_user,
|
||||
|
||||
@@ -38,7 +38,7 @@ pub(crate) async fn kick_user_route(
|
||||
body.user_id.to_string(),
|
||||
&assign!(RoomMemberEventContent::new(MembershipState::Leave), {
|
||||
reason: body.reason.clone(),
|
||||
// TODO(upstream): MSC4293
|
||||
redact_events: body.redact_events,
|
||||
}),
|
||||
),
|
||||
sender_user,
|
||||
|
||||
@@ -6,7 +6,9 @@ use conduwuit::{
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId };
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId, RoomId,
|
||||
RoomVersionId,
|
||||
};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
type Parsed = (OwnedRoomId, OwnedEventId, CanonicalJsonObject);
|
||||
@@ -40,7 +42,10 @@ fn extract_room_id(event_type: &str, pdu: &CanonicalJsonObject) -> Result<OwnedR
|
||||
return Err!(Request(BadJson("Unknown room version in pdu")));
|
||||
};
|
||||
|
||||
if !room_version_rules.authorization.room_create_event_id_as_room_id {
|
||||
if !room_version_rules
|
||||
.authorization
|
||||
.room_create_event_id_as_room_id
|
||||
{
|
||||
return Err!(Request(BadJson("Missing room_id in pdu")));
|
||||
}
|
||||
|
||||
@@ -116,9 +121,10 @@ pub async fn parse_incoming_pdu(&self, pdu: &RawJsonValue) -> Result<Parsed> {
|
||||
.rules()
|
||||
.unwrap();
|
||||
|
||||
let (event_id, value) = gen_event_id_canonical_json(pdu, &room_version_rules).map_err(|e| {
|
||||
err!(Request(InvalidParam("Could not convert event to canonical json: {e}")))
|
||||
})?;
|
||||
let (event_id, value) =
|
||||
gen_event_id_canonical_json(pdu, &room_version_rules).map_err(|e| {
|
||||
err!(Request(InvalidParam("Could not convert event to canonical json: {e}")))
|
||||
})?;
|
||||
self.validate_pdu(&value)?;
|
||||
Ok((room_id, event_id, value))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user