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]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.14.1"
|
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 = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"js_int",
|
"js_int",
|
||||||
@@ -4659,7 +4659,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-appservice-api"
|
name = "ruma-appservice-api"
|
||||||
version = "0.14.1"
|
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 = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4671,7 +4671,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.22.1"
|
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 = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
@@ -4693,7 +4693,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.17.1"
|
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 = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@@ -4726,7 +4726,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.32.1"
|
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 = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@@ -4747,7 +4747,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-federation-api"
|
name = "ruma-federation-api"
|
||||||
version = "0.13.1"
|
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 = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers",
|
"headers",
|
||||||
@@ -4770,7 +4770,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identifiers-validation"
|
name = "ruma-identifiers-validation"
|
||||||
version = "0.12.0"
|
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 = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
@@ -4779,7 +4779,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.17.1"
|
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 = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@@ -4795,7 +4795,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-push-gateway-api"
|
name = "ruma-push-gateway-api"
|
||||||
version = "0.13.0"
|
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 = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4807,7 +4807,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-signatures"
|
name = "ruma-signatures"
|
||||||
version = "0.19.0"
|
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 = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
@@ -4823,7 +4823,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-state-res"
|
name = "ruma-state-res"
|
||||||
version = "0.15.0"
|
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 = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4837,7 +4837,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruminuwuity"
|
name = "ruminuwuity"
|
||||||
version = "0.5.7"
|
version = "0.5.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"ruma",
|
"ruma",
|
||||||
|
|||||||
+2
-1
@@ -349,7 +349,7 @@ version = "1.1.1"
|
|||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
# version = "0.14.1"
|
# version = "0.14.1"
|
||||||
git = "https://github.com/ruma/ruma.git"
|
git = "https://github.com/ruma/ruma.git"
|
||||||
rev = "985dec87f235f169b3adddf3a7d37f590403e6e9"
|
rev = "8b522a87b541be0802fb3c7820747a6869d37318"
|
||||||
features = [
|
features = [
|
||||||
"appservice-api-c",
|
"appservice-api-c",
|
||||||
"client-api",
|
"client-api",
|
||||||
@@ -382,6 +382,7 @@ features = [
|
|||||||
"unstable-msc4373",
|
"unstable-msc4373",
|
||||||
"unstable-msc4380",
|
"unstable-msc4380",
|
||||||
"unstable-msc4143",
|
"unstable-msc4143",
|
||||||
|
"unstable-msc4293",
|
||||||
"unstable-msc4406",
|
"unstable-msc4406",
|
||||||
"unstable-msc4439",
|
"unstable-msc4439",
|
||||||
"unstable-extensible-events",
|
"unstable-extensible-events",
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ pub(crate) async fn ban_user_route(
|
|||||||
PartialPdu::state(
|
PartialPdu::state(
|
||||||
body.user_id.to_string(),
|
body.user_id.to_string(),
|
||||||
&assign!(RoomMemberEventContent::new(MembershipState::Ban), {
|
&assign!(RoomMemberEventContent::new(MembershipState::Ban), {
|
||||||
reason: body.reason.clone()
|
reason: body.reason.clone(),
|
||||||
// TODO(upstream): MSC4293
|
redact_events: body.redact_events,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
sender_user,
|
sender_user,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ pub(crate) async fn kick_user_route(
|
|||||||
body.user_id.to_string(),
|
body.user_id.to_string(),
|
||||||
&assign!(RoomMemberEventContent::new(MembershipState::Leave), {
|
&assign!(RoomMemberEventContent::new(MembershipState::Leave), {
|
||||||
reason: body.reason.clone(),
|
reason: body.reason.clone(),
|
||||||
// TODO(upstream): MSC4293
|
redact_events: body.redact_events,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
sender_user,
|
sender_user,
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ use conduwuit::{
|
|||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId };
|
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId, RoomId,
|
||||||
|
RoomVersionId,
|
||||||
|
};
|
||||||
use serde_json::value::RawValue as RawJsonValue;
|
use serde_json::value::RawValue as RawJsonValue;
|
||||||
|
|
||||||
type Parsed = (OwnedRoomId, OwnedEventId, CanonicalJsonObject);
|
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")));
|
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")));
|
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()
|
.rules()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (event_id, value) = gen_event_id_canonical_json(pdu, &room_version_rules).map_err(|e| {
|
let (event_id, value) =
|
||||||
err!(Request(InvalidParam("Could not convert event to canonical json: {e}")))
|
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)?;
|
self.validate_pdu(&value)?;
|
||||||
Ok((room_id, event_id, value))
|
Ok((room_id, event_id, value))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user