federation-api: add unstable support for MSC4125
This commit is contained in:
		
							parent
							
								
									047764bc15
								
							
						
					
					
						commit
						f01f00a90a
					
				@ -8,6 +8,8 @@ Breaking changes:
 | 
				
			|||||||
Improvements:
 | 
					Improvements:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Implement `From<SpaceHierarchyParentSummary>` for `SpaceHierarchyChildSummary`
 | 
					* Implement `From<SpaceHierarchyParentSummary>` for `SpaceHierarchyChildSummary`
 | 
				
			||||||
 | 
					* Add unstable support for optional `via` field on the `create_invite` endpoint request from
 | 
				
			||||||
 | 
					  MSC4125 behind the `unstable-msc4125` feature.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 0.8.0
 | 
					# 0.8.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@ unstable-exhaustive-types = []
 | 
				
			|||||||
unstable-msc2448 = []
 | 
					unstable-msc2448 = []
 | 
				
			||||||
unstable-msc3618 = []
 | 
					unstable-msc3618 = []
 | 
				
			||||||
unstable-msc3723 = []
 | 
					unstable-msc3723 = []
 | 
				
			||||||
 | 
					unstable-msc4125 = []
 | 
				
			||||||
unstable-unspecified = []
 | 
					unstable-unspecified = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[dependencies]
 | 
					[dependencies]
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,8 @@
 | 
				
			|||||||
//!
 | 
					//!
 | 
				
			||||||
//! [spec]: https://spec.matrix.org/latest/server-server-api/#put_matrixfederationv2inviteroomideventid
 | 
					//! [spec]: https://spec.matrix.org/latest/server-server-api/#put_matrixfederationv2inviteroomideventid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#[cfg(feature = "unstable-msc4125")]
 | 
				
			||||||
 | 
					use ruma_common::OwnedServerName;
 | 
				
			||||||
use ruma_common::{
 | 
					use ruma_common::{
 | 
				
			||||||
    api::{request, response, Metadata},
 | 
					    api::{request, response, Metadata},
 | 
				
			||||||
    metadata,
 | 
					    metadata,
 | 
				
			||||||
@ -39,6 +41,14 @@ pub struct Request {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /// An optional list of simplified events to help the receiver of the invite identify the room.
 | 
					    /// An optional list of simplified events to help the receiver of the invite identify the room.
 | 
				
			||||||
    pub invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
 | 
					    pub invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// An optional list of servers the invited homeserver should attempt to join or leave via,
 | 
				
			||||||
 | 
					    /// according to [MSC4125](https://github.com/matrix-org/matrix-spec-proposals/pull/4125).
 | 
				
			||||||
 | 
					    ///
 | 
				
			||||||
 | 
					    /// If present, it must not be empty.
 | 
				
			||||||
 | 
					    #[cfg(feature = "unstable-msc4125")]
 | 
				
			||||||
 | 
					    #[serde(skip_serializing_if = "Option::is_none", rename = "org.matrix.msc4125.via")]
 | 
				
			||||||
 | 
					    pub via: Option<Vec<OwnedServerName>>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Response type for the `create_invite` endpoint.
 | 
					/// Response type for the `create_invite` endpoint.
 | 
				
			||||||
@ -58,7 +68,15 @@ impl Request {
 | 
				
			|||||||
        event: Box<RawJsonValue>,
 | 
					        event: Box<RawJsonValue>,
 | 
				
			||||||
        invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
 | 
					        invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
 | 
				
			||||||
    ) -> Self {
 | 
					    ) -> Self {
 | 
				
			||||||
        Self { room_id, event_id, room_version, event, invite_room_state }
 | 
					        Self {
 | 
				
			||||||
 | 
					            room_id,
 | 
				
			||||||
 | 
					            event_id,
 | 
				
			||||||
 | 
					            room_version,
 | 
				
			||||||
 | 
					            event,
 | 
				
			||||||
 | 
					            invite_room_state,
 | 
				
			||||||
 | 
					            #[cfg(feature = "unstable-msc4125")]
 | 
				
			||||||
 | 
					            via: None,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -216,6 +216,7 @@ unstable-msc3956 = ["ruma-events?/unstable-msc3956"]
 | 
				
			|||||||
unstable-msc3983 = ["ruma-client-api?/unstable-msc3983"]
 | 
					unstable-msc3983 = ["ruma-client-api?/unstable-msc3983"]
 | 
				
			||||||
unstable-msc4075 = ["ruma-events?/unstable-msc4075"]
 | 
					unstable-msc4075 = ["ruma-events?/unstable-msc4075"]
 | 
				
			||||||
unstable-msc4121 = ["ruma-client-api?/unstable-msc4121"]
 | 
					unstable-msc4121 = ["ruma-client-api?/unstable-msc4121"]
 | 
				
			||||||
 | 
					unstable-msc4125 = ["ruma-federation-api?/unstable-msc4125"]
 | 
				
			||||||
unstable-pdu = ["ruma-events?/unstable-pdu"]
 | 
					unstable-pdu = ["ruma-events?/unstable-pdu"]
 | 
				
			||||||
unstable-unspecified = [
 | 
					unstable-unspecified = [
 | 
				
			||||||
    "ruma-common/unstable-unspecified",
 | 
					    "ruma-common/unstable-unspecified",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user