federation-api: Move knock out of unstable-pre-spec

This commit is contained in:
Kévin Commaille 2022-02-10 14:43:14 +01:00 committed by GitHub
parent e93511e993
commit 69134c21e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 12 deletions

View File

@ -7,6 +7,11 @@ Breaking changes:
* Make `device_display_name` field optional in `DeviceListUpdateContent` and update constructor accordingly * Make `device_display_name` field optional in `DeviceListUpdateContent` and update constructor accordingly
* Remove unneeded `minimum_valid_until_ts` query parameter from `get_remote_server_keys_batch` endpoint * Remove unneeded `minimum_valid_until_ts` query parameter from `get_remote_server_keys_batch` endpoint
Improvements:
* Move `knock` module out of `unstable-pre-spec`
* `knock:::send_knock::v1::Request` requires a PDU instead of the `knock_event`
# 0.3.1 # 0.3.1
Bug fixes: Bug fixes:

View File

@ -1,4 +1,4 @@
//! [GET /_matrix/federation/v1/make_knock/{roomId}/{userId}](https://spec.matrix.org/unstable/server-server-api/#get_matrixfederationv1make_knockroomiduserid) //! [GET /_matrix/federation/v1/make_knock/{roomId}/{userId}](https://spec.matrix.org/v1.1/server-server-api/#get_matrixfederationv1make_knockroomiduserid)
use ruma_api::ruma_api; use ruma_api::ruma_api;
use ruma_identifiers::{RoomId, RoomVersionId, UserId}; use ruma_identifiers::{RoomId, RoomVersionId, UserId};

View File

@ -1,8 +1,9 @@
//! [PUT /_matrix/federation/v1/send_knock/{roomId}/{eventId}](https://spec.matrix.org/unstable/server-server-api/#put_matrixfederationv1send_knockroomideventid) //! [PUT /_matrix/federation/v1/send_knock/{roomId}/{eventId}](https://spec.matrix.org/v1.1/server-server-api/#put_matrixfederationv1send_knockroomideventid)
use ruma_api::ruma_api; use ruma_api::ruma_api;
use ruma_events::{room::member::RoomMemberEvent, AnyStrippedStateEvent}; use ruma_events::AnyStrippedStateEvent;
use ruma_identifiers::{EventId, RoomId}; use ruma_identifiers::{EventId, RoomId};
use serde_json::value::RawValue as RawJsonValue;
ruma_api! { ruma_api! {
metadata: { metadata: {
@ -23,9 +24,9 @@ ruma_api! {
#[ruma_api(path)] #[ruma_api(path)]
pub event_id: &'a EventId, pub event_id: &'a EventId,
/// The full knock event. /// The PDU.
#[ruma_api(body)] #[ruma_api(body)]
pub knock_event: &'a RoomMemberEvent, pub pdu: &'a RawJsonValue,
} }
response: { response: {
@ -36,12 +37,8 @@ ruma_api! {
impl<'a> Request<'a> { impl<'a> Request<'a> {
/// Creates a new `Request` with the given room ID, event ID and knock event. /// Creates a new `Request` with the given room ID, event ID and knock event.
pub fn new( pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: &'a RawJsonValue) -> Self {
room_id: &'a RoomId, Self { room_id, event_id, pdu }
event_id: &'a EventId,
knock_event: &'a RoomMemberEvent,
) -> Self {
Self { room_id, event_id, knock_event }
} }
} }

View File

@ -17,7 +17,6 @@ pub mod directory;
pub mod discovery; pub mod discovery;
pub mod event; pub mod event;
pub mod keys; pub mod keys;
#[cfg(feature = "unstable-pre-spec")]
pub mod knock; pub mod knock;
pub mod membership; pub mod membership;
pub mod openid; pub mod openid;