mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-27 00:56:36 +02:00
Add room version H11
This commit is contained in:
parent
d7514178ab
commit
bb69ee68d0
3 changed files with 37 additions and 23 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -3695,7 +3695,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"js_int",
|
"js_int",
|
||||||
|
@ -3715,7 +3714,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-appservice-api"
|
name = "ruma-appservice-api"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -3727,7 +3725,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
|
@ -3750,7 +3747,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
@ -3782,7 +3778,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.28.1"
|
version = "0.28.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap 2.9.0",
|
"indexmap 2.9.0",
|
||||||
|
@ -3807,7 +3802,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-federation-api"
|
name = "ruma-federation-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers",
|
"headers",
|
||||||
|
@ -3829,7 +3823,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identifiers-validation"
|
name = "ruma-identifiers-validation"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
@ -3838,7 +3831,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identity-service-api"
|
name = "ruma-identity-service-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -3848,7 +3840,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
|
@ -3863,7 +3854,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-push-gateway-api"
|
name = "ruma-push-gateway-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -3875,7 +3865,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-signatures"
|
name = "ruma-signatures"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=d6870a7fb7f6cccff63f7fd0ff6c581bad80e983#d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
|
|
|
@ -348,9 +348,9 @@ version = "0.1.2"
|
||||||
|
|
||||||
# Used for matrix spec type definitions and helpers
|
# Used for matrix spec type definitions and helpers
|
||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
#git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
||||||
#branch = "conduwuit-changes"
|
#rev = "b1a55ab8fa3d2e3db3240d04339835f71cfc84d4"
|
||||||
rev = "d6870a7fb7f6cccff63f7fd0ff6c581bad80e983"
|
path = "../ruwuma/crates/ruma" # nex: temp
|
||||||
features = [
|
features = [
|
||||||
"compat",
|
"compat",
|
||||||
"rand",
|
"rand",
|
||||||
|
|
|
@ -29,6 +29,8 @@ pub enum StateResolutionVersion {
|
||||||
V1,
|
V1,
|
||||||
/// State resolution for room at version 2 or later.
|
/// State resolution for room at version 2 or later.
|
||||||
V2,
|
V2,
|
||||||
|
/// State resolution for hydra rooms
|
||||||
|
V2_1,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||||
|
@ -80,6 +82,19 @@ pub struct RoomVersion {
|
||||||
///
|
///
|
||||||
/// See: [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175) for more information.
|
/// See: [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175) for more information.
|
||||||
pub use_room_create_sender: bool,
|
pub use_room_create_sender: bool,
|
||||||
|
/// Whether the room creator is a superuser.
|
||||||
|
/// A superuser will always have infinite power level and gains special privileges.
|
||||||
|
///
|
||||||
|
/// See: [MSC4289](https://github.com/matrix-org/matrix-spec-proposals/pull/4289) for more information.
|
||||||
|
pub room_creator_is_superuser: bool,
|
||||||
|
/// Whether the room version supports estoppel events.
|
||||||
|
///
|
||||||
|
/// See: [MSC4290](https://github.com/matrix-org/matrix-spec-proposals/pull/4290)
|
||||||
|
pub estoppel_events: bool,
|
||||||
|
/// Whether the room's m.room.create event ID is itself the room ID.
|
||||||
|
///
|
||||||
|
/// See: [MSC4291](https://github.com/matrix-org/matrix-spec-proposals/pull/4291)
|
||||||
|
pub create_id_as_room_id: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RoomVersion {
|
impl RoomVersion {
|
||||||
|
@ -97,15 +112,9 @@ impl RoomVersion {
|
||||||
knock_restricted_join_rule: false,
|
knock_restricted_join_rule: false,
|
||||||
integer_power_levels: false,
|
integer_power_levels: false,
|
||||||
use_room_create_sender: false,
|
use_room_create_sender: false,
|
||||||
};
|
room_creator_is_superuser: false,
|
||||||
pub const V10: Self = Self {
|
estoppel_events: false,
|
||||||
knock_restricted_join_rule: true,
|
create_id_as_room_id: false,
|
||||||
integer_power_levels: true,
|
|
||||||
..Self::V9
|
|
||||||
};
|
|
||||||
pub const V11: Self = Self {
|
|
||||||
use_room_create_sender: true,
|
|
||||||
..Self::V10
|
|
||||||
};
|
};
|
||||||
pub const V2: Self = Self {
|
pub const V2: Self = Self {
|
||||||
state_res: StateResolutionVersion::V2,
|
state_res: StateResolutionVersion::V2,
|
||||||
|
@ -130,6 +139,21 @@ impl RoomVersion {
|
||||||
pub const V7: Self = Self { allow_knocking: true, ..Self::V6 };
|
pub const V7: Self = Self { allow_knocking: true, ..Self::V6 };
|
||||||
pub const V8: Self = Self { restricted_join_rules: true, ..Self::V7 };
|
pub const V8: Self = Self { restricted_join_rules: true, ..Self::V7 };
|
||||||
pub const V9: Self = Self::V8;
|
pub const V9: Self = Self::V8;
|
||||||
|
pub const V10: Self = Self {
|
||||||
|
knock_restricted_join_rule: true,
|
||||||
|
integer_power_levels: true,
|
||||||
|
..Self::V9
|
||||||
|
};
|
||||||
|
pub const V11: Self = Self {
|
||||||
|
use_room_create_sender: true,
|
||||||
|
..Self::V10
|
||||||
|
};
|
||||||
|
pub const HYDRA_V11: Self = Self{
|
||||||
|
room_creator_is_superuser: true,
|
||||||
|
estoppel_events: true,
|
||||||
|
create_id_as_room_id: true,
|
||||||
|
..Self::V11
|
||||||
|
};
|
||||||
|
|
||||||
pub fn new(version: &RoomVersionId) -> Result<Self> {
|
pub fn new(version: &RoomVersionId) -> Result<Self> {
|
||||||
Ok(match version {
|
Ok(match version {
|
||||||
|
@ -144,6 +168,7 @@ impl RoomVersion {
|
||||||
| RoomVersionId::V9 => Self::V9,
|
| RoomVersionId::V9 => Self::V9,
|
||||||
| RoomVersionId::V10 => Self::V10,
|
| RoomVersionId::V10 => Self::V10,
|
||||||
| RoomVersionId::V11 => Self::V11,
|
| RoomVersionId::V11 => Self::V11,
|
||||||
|
| RoomVersionId::HydraV11 => Self::HYDRA_V11,
|
||||||
| ver => return Err(Error::Unsupported(format!("found version `{ver}`"))),
|
| ver => return Err(Error::Unsupported(format!("found version `{ver}`"))),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue