Merge remote-tracking branch 'upstream/main' into conduwuit-changes
This commit is contained in:
commit
ade2f1daf0
@ -15,6 +15,8 @@ Breaking changes:
|
||||
|
||||
Improvements:
|
||||
|
||||
- Add support for MSC4186, aka simplified sliding sync, behind
|
||||
`unstable-msc4186`.
|
||||
- Add support for MSC4108 OIDC sign in and E2EE set up via QR code
|
||||
- Heroes in `sync::sync_events::v4`: `SyncRequestList` and `RoomSubscription`
|
||||
both have a new `include_heroes` field. `SlidingSyncRoom` has a new `heroes`
|
||||
@ -32,6 +34,8 @@ Improvements:
|
||||
- Change types of `SyncRequestListFilters::{room_types,not_room_types}` to
|
||||
`Vec<RoomTypeFilter>` instead of a vector of strings
|
||||
- This is a breaking change, but only for users of `unstable-msc3575`
|
||||
- Add the `get_login_token` field to `Capabilities`, according to a
|
||||
clarification in the spec.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
|
@ -43,6 +43,15 @@ pub struct Capabilities {
|
||||
#[serde(rename = "m.3pid_changes", default)]
|
||||
pub thirdparty_id_changes: ThirdPartyIdChangesCapability,
|
||||
|
||||
/// Capability to indicate if the user can generate tokens to log further clients into their
|
||||
/// account.
|
||||
#[serde(
|
||||
rename = "m.get_login_token",
|
||||
default,
|
||||
skip_serializing_if = "GetLoginTokenCapability::is_default"
|
||||
)]
|
||||
pub get_login_token: GetLoginTokenCapability,
|
||||
|
||||
/// Any other custom capabilities that the server supports outside of the specification,
|
||||
/// labeled using the Java package naming convention and stored as arbitrary JSON values.
|
||||
#[serde(flatten)]
|
||||
@ -272,6 +281,26 @@ impl Default for ThirdPartyIdChangesCapability {
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about the `m.get_login_token` capability.
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct GetLoginTokenCapability {
|
||||
/// Whether the user can request a login token.
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
impl GetLoginTokenCapability {
|
||||
/// Creates a new `GetLoginTokenCapability` with the given enabled flag.
|
||||
pub fn new(enabled: bool) -> Self {
|
||||
Self { enabled }
|
||||
}
|
||||
|
||||
/// Returns whether all fields have their default value.
|
||||
pub fn is_default(&self) -> bool {
|
||||
!self.enabled
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::borrow::Cow;
|
||||
|
@ -981,7 +981,7 @@ impl From<v5::request::List> for SyncRequestList {
|
||||
#[cfg(feature = "unstable-msc4186")]
|
||||
impl From<v5::request::RoomDetails> for RoomDetailsConfig {
|
||||
fn from(value: v5::request::RoomDetails) -> Self {
|
||||
Self { required_state: value.required_state, timeline_limit: value.timeline_limit }
|
||||
Self { required_state: value.required_state, timeline_limit: Some(value.timeline_limit) }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1001,7 +1001,7 @@ impl From<v5::request::RoomSubscription> for RoomSubscription {
|
||||
fn from(value: v5::request::RoomSubscription) -> Self {
|
||||
Self {
|
||||
required_state: value.required_state,
|
||||
timeline_limit: value.timeline_limit,
|
||||
timeline_limit: Some(value.timeline_limit),
|
||||
include_heroes: value.include_heroes,
|
||||
}
|
||||
}
|
||||
|
@ -154,8 +154,7 @@ pub mod request {
|
||||
pub required_state: Vec<(StateEventType, String)>,
|
||||
|
||||
/// The maximum number of timeline events to return per room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub timeline_limit: Option<UInt>,
|
||||
pub timeline_limit: UInt,
|
||||
|
||||
/// Include the room heroes.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -171,8 +170,7 @@ pub mod request {
|
||||
pub required_state: Vec<(StateEventType, String)>,
|
||||
|
||||
/// The maximum number of timeline events to return per room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub timeline_limit: Option<UInt>,
|
||||
pub timeline_limit: UInt,
|
||||
}
|
||||
|
||||
/// Sliding sync request extensions (see [`super::Request::extensions`]).
|
||||
@ -420,10 +418,6 @@ pub mod request {
|
||||
/// Response type for the `/sync` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Whether this response describes an initial sync.
|
||||
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
|
||||
pub initial: bool,
|
||||
|
||||
/// Matches the `txn_id` sent by the request (see [`Request::txn_id`]).
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub txn_id: Option<String>,
|
||||
@ -449,7 +443,6 @@ impl Response {
|
||||
/// Creates a new `Response` with the given `pos`.
|
||||
pub fn new(pos: String) -> Self {
|
||||
Self {
|
||||
initial: Default::default(),
|
||||
txn_id: None,
|
||||
pos,
|
||||
lists: Default::default(),
|
||||
@ -737,7 +730,6 @@ impl From<v4::Response> for Response {
|
||||
fn from(value: v4::Response) -> Self {
|
||||
Self {
|
||||
pos: value.pos,
|
||||
initial: value.initial,
|
||||
txn_id: value.txn_id,
|
||||
lists: value.lists.into_iter().map(|(room_id, list)| (room_id, list.into())).collect(),
|
||||
rooms: value.rooms.into_iter().map(|(room_id, room)| (room_id, room.into())).collect(),
|
||||
|
@ -1,5 +1,10 @@
|
||||
# [unreleased]
|
||||
|
||||
Bug fixes:
|
||||
|
||||
- `ServerSigningKeys` can be deserialized when `old_verify_keys` is missing, due to a
|
||||
clarification in the spec.
|
||||
|
||||
Improvements:
|
||||
|
||||
- Add support for authenticated media endpoints, according to MSC3916 / Matrix 1.11
|
||||
|
@ -48,7 +48,6 @@ impl OldVerifyKey {
|
||||
}
|
||||
}
|
||||
|
||||
// Spec is wrong, all fields are required (see https://github.com/matrix-org/matrix-spec/issues/613)
|
||||
/// Queried server key, signed by the notary server.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
@ -60,6 +59,9 @@ pub struct ServerSigningKeys {
|
||||
pub verify_keys: BTreeMap<OwnedServerSigningKeyId, VerifyKey>,
|
||||
|
||||
/// Public keys that the homeserver used to use and when it stopped using them.
|
||||
// This field is optional, but all fields were assumed to be required before clarification
|
||||
// in https://github.com/matrix-org/matrix-spec/pull/1930, so we still send it.
|
||||
#[serde(default)]
|
||||
pub old_verify_keys: BTreeMap<OwnedServerSigningKeyId, OldVerifyKey>,
|
||||
|
||||
/// Digital signatures of this object signed using the verify_keys.
|
||||
|
Loading…
x
Reference in New Issue
Block a user